mirror of https://github.com/microsoft/clang.git
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301647 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ad2cd105c1
commit
de4f6266fa
|
@ -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>;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue