[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / c11-generic-3.c
blob8bac21ed31fae42baade196336958914e396b5f9
1 /* Test C11 _Generic. Test we follow the resolution of DR#423. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c11 -pedantic-errors" } */
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" } */