summaryrefslogtreecommitdiff
path: root/compiler/main/DynFlags.hs
diff options
context:
space:
mode:
authorKari Pahula <kaol@iki.fi>2019-09-24 16:33:15 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-25 13:52:48 -0400
commit2970dc7ab95f7daa793112c6a4a682263561761c (patch)
treebcbc7c565479441427e5e512b6c71d85ce6d497e /compiler/main/DynFlags.hs
parent218c5dbfbd60a416588e1b952c167ebd18ef9c56 (diff)
downloadhaskell-2970dc7ab95f7daa793112c6a4a682263561761c.tar.gz
Add -Wderiving-defaults (#15839)
Enabling both DeriveAnyClass and GeneralizedNewtypeDeriving can cause a warning when no explicit deriving strategy is in use. This change adds an enable/suppress flag for it.
Diffstat (limited to 'compiler/main/DynFlags.hs')
-rw-r--r--compiler/main/DynFlags.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 5bd8cb819f..45a465bd9c 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -920,6 +920,7 @@ data WarningFlag =
| Opt_WarnUnusedPackages -- Since 8.10
| Opt_WarnInferredSafeImports -- Since 8.10
| Opt_WarnMissingSafeHaskellMode -- Since 8.10
+ | Opt_WarnDerivingDefaults
deriving (Eq, Show, Enum)
data Language = Haskell98 | Haskell2010
@@ -4026,6 +4027,7 @@ wWarningFlagsDeps = [
Opt_WarnDeferredOutOfScopeVariables,
flagSpec "deprecations" Opt_WarnWarningsDeprecations,
flagSpec "deprecated-flags" Opt_WarnDeprecatedFlags,
+ flagSpec "deriving-defaults" Opt_WarnDerivingDefaults,
flagSpec "deriving-typeable" Opt_WarnDerivingTypeable,
flagSpec "dodgy-exports" Opt_WarnDodgyExports,
flagSpec "dodgy-foreign-imports" Opt_WarnDodgyForeignImports,
@@ -4824,6 +4826,7 @@ standardWarnings -- see Note [Documenting warning flags]
Opt_WarnPartialTypeSignatures,
Opt_WarnUnrecognisedPragmas,
Opt_WarnDuplicateExports,
+ Opt_WarnDerivingDefaults,
Opt_WarnOverflowedLiterals,
Opt_WarnEmptyEnumerations,
Opt_WarnMissingFields,