Due to a bug, -Wno-everything works like -Weverything. Fix the bug by having
-Wno-everything remap all warnings to ignored.
We can now use "-Wno-everything -W<warning>" to ignore all warnings except
specific ones.
llvm-svn: 149121
diff --git a/clang/lib/Frontend/Warnings.cpp b/clang/lib/Frontend/Warnings.cpp
index 576dd3d..f68e03b 100644
--- a/clang/lib/Frontend/Warnings.cpp
+++ b/clang/lib/Frontend/Warnings.cpp
@@ -110,8 +110,14 @@
// -Weverything is a special case as well. It implicitly enables all
// warnings, including ones not explicitly in a warning group.
if (Opt == "everything") {
- if (SetDiagnostic)
- Diags.setEnableAllWarnings(true);
+ if (SetDiagnostic) {
+ if (isPositive) {
+ Diags.setEnableAllWarnings(true);
+ } else {
+ Diags.setEnableAllWarnings(false);
+ Diags.setMappingToAllDiagnostics(diag::MAP_IGNORE);
+ }
+ }
continue;
}