llvm-project
21 строка · 599.0 Байт
1// RUN: %clang_cc1 -std=c1x -fsyntax-only -verify %s
2
3void foo(void) {4_Generic; // expected-error {{expected '('}}5(void) _Generic(0); // expected-error {{expected ','}}6(void) _Generic(0, void); // expected-error {{expected ':'}}7(void) _Generic(0,8default: 0, // expected-note {{previous default generic association is here}}9default: 0); // expected-error {{duplicate default generic association}}10}
11
12enum E { e };13int bar(int n) {14// PR4572615return _Generic(0, enum E: n, default: 0);16}
17
18int baz(int n) {19// PR3997920return _Generic(0, enum { e }: n, default: 0);21}
22