r301647 - Use the -Wunknown-warning-option group for the "unknown warning group"
Alex Lorenz via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 28 07:45:25 PDT 2017
Author: arphaman
Date: Fri Apr 28 09:45:25 2017
New Revision: 301647
URL: http://llvm.org/viewvc/llvm-project?rev=301647&view=rev
Log:
Use the -Wunknown-warning-option group for the "unknown warning group"
diagnostic in #pragma diagnostic
This matches the warning group that's specified for the unknown warning options
that are passed-in as command line arguments.
rdar://29526025
Modified:
cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
cfe/trunk/test/Preprocessor/pragma_diagnostic.c
Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=301647&r1=301646&r2=301647&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Fri Apr 28 09:45:25 2017
@@ -503,7 +503,7 @@ def warn_pragma_diagnostic_invalid_token
InGroup<UnknownPragmas>;
def warn_pragma_diagnostic_unknown_warning :
ExtWarn<"unknown warning group '%0', ignored">,
- InGroup<UnknownPragmas>;
+ InGroup<UnknownWarningOption>;
// - #pragma __debug
def warn_pragma_debug_unexpected_command : Warning<
"unexpected debug command '%0'">, InGroup<IgnoredPragmas>;
Modified: cfe/trunk/test/Preprocessor/pragma_diagnostic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/pragma_diagnostic.c?rev=301647&r1=301646&r2=301647&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/pragma_diagnostic.c (original)
+++ cfe/trunk/test/Preprocessor/pragma_diagnostic.c Fri Apr 28 09:45:25 2017
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-undef %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-undef -Wno-unknown-warning-option -DAVOID_UNKNOWN_WARNING %s
// rdar://2362963
#if FOO // ok.
@@ -28,8 +29,10 @@
#pragma GCC diagnostic error "-Wundef" 42 // expected-warning {{unexpected token in pragma diagnostic}}
#pragma GCC diagnostic error "invalid-name" // expected-warning {{pragma diagnostic expected option name (e.g. "-Wundef")}}
-#pragma GCC diagnostic error "-Winvalid-name" // expected-warning {{unknown warning group '-Winvalid-name', ignored}}
-
+#pragma GCC diagnostic error "-Winvalid-name"
+#ifndef AVOID_UNKNOWN_WARNING
+// expected-warning at -2 {{unknown warning group '-Winvalid-name', ignored}}
+#endif
// Testing pragma clang diagnostic with -Weverything
void ppo(){} // First test that we do not diagnose on this.
More information about the cfe-commits
mailing list