libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c2y-generic-2.c
blobc37fcc1283b9b3bcc7cbfb15c0a6f24f457aef9a
1 /* Test C2Y _Generic features: warning with -Wc23-c2y-compat. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c2y -pedantic-errors -Wc23-c2y-compat" } */
5 _Static_assert (_Generic (const int, int : 1, const int : 2) == 2); /* { dg-warning "use of type name" } */
7 _Static_assert (_Generic (void, int : 1, void : 2) == 2); /* { dg-warning "use of type name" } */
8 /* { dg-warning "incomplete type" "incomplete type" { target *-*-* } .-1 } */
10 _Static_assert (_Generic (int (), int (*) () : 1, int () : 2) == 2); /* { dg-warning "use of type name" } */
11 /* { dg-warning "function type" "function type" { target *-*-* } .-1 } */
13 const int ci;
15 _Static_assert (_Generic (typeof (ci), const int : 1, int : 2) == 1); /* { dg-warning "use of type name" } */
17 _Static_assert (_Generic (ci, const int : 1, int : 2) == 2);