c++: Implement for namespace statics CWG 2867 - Order of initialization for structure...
[official-gcc.git] / gcc / testsuite / gcc.dg / gnu2y-generic-1.c
blob98868ad51d1c602b0502c9e9cee0e99c60f18264
1 /* Test C2Y _Generic features: __extension__ suppresses -Wc23-c2y-compat
2 warnings (and the state is restored after __extension__). */
3 /* { dg-do compile } */
4 /* { dg-options "-std=gnu2y -pedantic-errors -Wc23-c2y-compat" } */
6 _Static_assert (__extension__ _Generic (const int, int : 1, const int : 2) == 2);
7 _Static_assert (_Generic (const int, int : 1, const int : 2) == 2); /* { dg-warning "use of type name" } */
9 _Static_assert (__extension__ _Generic (void, int : 1, void : 2) == 2);
10 _Static_assert (_Generic (void, int : 1, void : 2) == 2); /* { dg-warning "use of type name" } */
11 /* { dg-warning "incomplete type" "incomplete type" { target *-*-* } .-1 } */
13 _Static_assert (__extension__ _Generic (int (), int (*) () : 1, int () : 2) == 2);
14 _Static_assert (_Generic (int (), int (*) () : 1, int () : 2) == 2); /* { dg-warning "use of type name" } */
15 /* { dg-warning "function type" "function type" { target *-*-* } .-1 } */