1 // RUN: %clang_cc1 -Wpedantic-macros %s -fsyntax-only -verify 2 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. 6 7 #include "Inputs/pedantic-macro-interplay.h" 8 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!") 13 14 15 #define Foo 1 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) 22 23 // Test that unsafe_header and deprecated markings stick around after the undef 24 #include "Inputs/final-macro.h" 25 26 // expected-warning@+1{{macro 'Foo' has been marked as deprecated}} 27 const int X = Foo; 28