Debian Codegraph @

clang/test/C/C2y/n3260.c

raw
1 // RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -Wpre-c2y-compat %s
2 // RUN: %clang_cc1 -verify=pre-c2y -std=c23 -Wall -pedantic %s
3
4 /* WG14 N3260: Clang 17
5 * Generic selection expression with a type operand
6 */
7
8 static_assert(
9 _Generic(
10 const int, /* pre-c2y-warning {{passing a type argument as the first operand to '_Generic' is a C2y extension}}
11 expected-warning {{passing a type argument as the first operand to '_Generic' is incompatible with C standards before C2y}}
12 */
13 int : 0,
14 const int : 1
15 )
16 );