[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Lexer / pedantic-macro-interplay.c
blob5544577929b627b2d84fed71e57be3690cdbf1cf
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!")
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)
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}}
27 const int X = Foo;