aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2011-06-03 18:30:50 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2011-06-03 18:30:50 +0000
commit5a4cca2cc576bb42309e3e86befaa904283e9c8c (patch)
tree18600f339081a2ac466440ef7c7fee0b8cf9d837
parent0a62984eab0ab25ed0d0d974e6753a75447e404e (diff)
Don't warn about -Wno-foo where foo is an unknown warning option. Explicitly
passing -Wunknown-warning-option will re-enable warnings about -Wno-foo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132570 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticFrontendKinds.td3
-rw-r--r--lib/Frontend/Warnings.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td
index 67fc22e410..4aa85134aa 100644
--- a/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -281,6 +281,9 @@ def err_not_a_pch_file : Error<
def warn_unknown_warning_option : Warning<
"unknown warning option '%0'">,
InGroup<DiagGroup<"unknown-warning-option"> >;
+def warn_unknown_negative_warning_option : Warning<
+ "unknown warning option '%0'">,
+ InGroup<DiagGroup<"unknown-warning-option"> >, DefaultIgnore;
def warn_unknown_warning_specifier : Warning<
"unknown %0 warning specifier: '%1'">,
InGroup<DiagGroup<"unknown-warning-option"> >;
diff --git a/lib/Frontend/Warnings.cpp b/lib/Frontend/Warnings.cpp
index 829ac9e661..f12b484c05 100644
--- a/lib/Frontend/Warnings.cpp
+++ b/lib/Frontend/Warnings.cpp
@@ -123,6 +123,8 @@ void clang::ProcessWarningOptions(Diagnostic &Diags,
}
if (Diags.setDiagnosticGroupMapping(Opt, Mapping))
- Diags.Report(diag::warn_unknown_warning_option) << ("-W" + Opt.str());
+ Diags.Report(isPositive ? diag::warn_unknown_warning_option :
+ diag::warn_unknown_negative_warning_option)
+ << ("-W" + Opt.str());
}
}