+
+---------------------------------------------------------------------------
+-- Checking stand-alone deriving declarations
+
+checkDerivDecl :: LDerivDecl RdrName -> P (LDerivDecl RdrName)
+checkDerivDecl d@(L loc _) =
+ do glaExtOn <- extension glaExtsEnabled
+ if glaExtOn then return d
+ else parseError loc "Illegal stand-alone deriving declaration (use -fglasgow-exts)"
+