| 1 |
/* Test C11 _Generic. Test we follow the resolution of DR#423. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-std=c11 -pedantic-errors" } */ |
| 4 |
|
| 5 |
char const *a = _Generic ("bla", char *: ""); |
| 6 |
char const *b = _Generic ("bla", char[4]: ""); /* { dg-error "not compatible with any association" } */ |
| 7 |
char const *c = _Generic ((int const) { 0 }, int: ""); |
| 8 |
char const *d = _Generic ((int const) { 0 }, int const: ""); /* { dg-error "not compatible with any association" } */ |
| 9 |
char const *e = _Generic (+(int const) { 0 }, int: ""); |
| 10 |
char const *f = _Generic (+(int const) { 0 }, int const: ""); /* { dg-error "not compatible with any association" } */ |