150
|
1 // RUN: %clang_cc1 -std=c1x -fsyntax-only -verify %s
|
|
2
|
|
3 void 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,
|
|
8 default: 0, // expected-note {{previous default generic association is here}}
|
|
9 default: 0); // expected-error {{duplicate default generic association}}
|
|
10 }
|
173
|
11
|
|
12 enum E { e };
|
|
13 int bar(int n) {
|
|
14 // PR45726
|
|
15 return _Generic(0, enum E: n, default: 0);
|
|
16 }
|
|
17
|
|
18 int baz(int n) {
|
|
19 // PR39979
|
|
20 return _Generic(0, enum { e }: n, default: 0);
|
|
21 }
|