Debian Codegraph @

gcc/testsuite/gcc.dg/c2y-generic-1.c

raw
1 /* Test C2Y _Generic features. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c2y -pedantic-errors" } */
4
5 _Static_assert (_Generic (const int, int : 1, const int : 2) == 2);
6
7 _Static_assert (_Generic (void, int : 1, void : 2) == 2);
8
9 _Static_assert (_Generic (int (), int (*) () : 1, int () : 2) == 2);
10
11 const int ci;
12
13 _Static_assert (_Generic (typeof (ci), const int : 1, int : 2) == 1);
14
15 _Static_assert (_Generic (ci, const int : 1, int : 2) == 2);