[PATCH] D15095: Accept "-Weverything" in pragma clang diagnostic ...

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 30 19:12:07 PST 2015


rsmith added a subscriber: rsmith.

================
Comment at: lib/Basic/Diagnostic.cpp:251-257
@@ -250,2 +250,9 @@
                                             SourceLocation Loc) {
+  // Special handling for pragma clang diagnostic ... "-Weverything"
+  // There is no formal group named "everything", so there has to be a special
+  // case for it.
+  if (Group == "everything") {
+   setSeverityForAll(Flavor, Map, Loc);
+   return false;
+  }
   // Get the diagnostics in this group.
----------------
If you want to handle this at the `DiagnosticsEngine` level, please do so consistently: teach `getDiagnosticsInGroup` about this special case too, and remove the now-redundant code in `clang::ProcessWarningOptions`.

This is not currently setting the `EnableAllWarnings` flag correctly on the `DiagnosticsEngine`.

================
Comment at: test/Frontend/Peverything.cpp:1
@@ +1,2 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+#pragma clang diagnostic error "-Weverything" 
----------------
This test belongs in **test/Preprocessor/pragma_diagnostic.c**.

================
Comment at: test/Frontend/Peverything.cpp:2
@@ +1,3 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+#pragma clang diagnostic error "-Weverything" 
+
----------------
Please also test that `#pragma clang diagnostic push/pop` work for this flag.


http://reviews.llvm.org/D15095





More information about the cfe-commits mailing list