summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-04-28 14:45:25 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-04-28 14:45:25 +0000
commit499de32ad03af6877ca2ee0780530ee4721b4062 (patch)
tree2a5afa00a07e8e27b2f12f59ea0499e7adf855c7
parentcce5097ce4ba8307562ff4fe2ece8c2a7721a190 (diff)
downloadbcm5719-llvm-499de32ad03af6877ca2ee0780530ee4721b4062.tar.gz
bcm5719-llvm-499de32ad03af6877ca2ee0780530ee4721b4062.zip
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 llvm-svn: 301647
-rw-r--r--clang/include/clang/Basic/DiagnosticLexKinds.td2
-rw-r--r--clang/test/Preprocessor/pragma_diagnostic.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td
index cf33d5fba3d..653be75a766 100644
--- a/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -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>;
diff --git a/clang/test/Preprocessor/pragma_diagnostic.c b/clang/test/Preprocessor/pragma_diagnostic.c
index 3970dbbc8e2..63d5907c67d 100644
--- a/clang/test/Preprocessor/pragma_diagnostic.c
+++ b/clang/test/Preprocessor/pragma_diagnostic.c
@@ -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@-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.
OpenPOWER on IntegriCloud