1 // RUN: %clang_cc1 -Wpedantic-macros %s -fsyntax-only -verify
3 // This test verifies that the -Wpedantic-macros warnings don't fire in the
4 // annotation pragmas themselves. This ensures you can annotate macros with
5 // more than one of the pragmas without spewing warnings all over the code.
7 #include "Inputs/pedantic-macro-interplay.h"
9 #define UNSAFE_MACRO_2 1
10 #pragma clang deprecated(UNSAFE_MACRO_2, "Don't use this!")
11 // not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been marked as deprecated: Don't use this!}}
12 #pragma clang restrict_expansion(UNSAFE_MACRO_2, "Don't use this!")
16 #pragma clang final(Foo)
17 // expected-note@+2{{macro marked 'deprecated' here}}
18 // expected-note@+1{{macro marked 'deprecated' here}}
19 #pragma clang deprecated(Foo)
20 // expected-note@+1{{macro marked 'restrict_expansion' here}}
21 #pragma clang restrict_expansion(Foo)
23 // Test that unsafe_header and deprecated markings stick around after the undef
24 #include "Inputs/final-macro.h"
26 // expected-warning@+1{{macro 'Foo' has been marked as deprecated}}