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
This commit is contained in:
Alex Lorenz 2017-04-28 14:45:25 +00:00
parent cce5097ce4
commit 499de32ad0
2 changed files with 6 additions and 3 deletions

View File

@ -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>;

View File

@ -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.