1 // RUN: %clang_cc1 -verify -fsyntax-only -Wshadow -Wold-style-cast -Wc++20-designator %s
3 // Test that macro expansions from system headers don't trigger 'syntactic'
4 // warnings that are not actionable.
7 #pragma clang system_header
9 #define SANITY(a) (a / 0)
11 #define SHADOW(a) __extension__({ int v = a; v; })
13 #define OLD_STYLE_CAST(a) ((int) (a))
18 #define DESIGNATED_INITIALIZERS (Foo{.x = 123})
26 // Validate that the test is set up correctly
27 int i
= SANITY(0); // expected-warning {{division by zero is undefined}}
31 // no -Wshadow in system macro expansion
32 int i
= SHADOW(SHADOW(1));
36 // no -Wold-style-cast in system macro expansion
37 int i
= OLD_STYLE_CAST(0);
41 // no -Wc++20-designator in system macro expansion
42 auto i
= DESIGNATED_INITIALIZERS
;