Reading <https://gcc.gnu.org/ml/gcc-patches/2016-05/msg01054.html> it occured to me that we might resolve c/65471, dealing with type interpretation in _Generic, too. Since it turned out that GCC already does the right thing, I'm only adding a new test. (We should discard qualifiers from controlling expression of _Generic.)
Regarding the bit-field issue, it seems that we should do nothing and keep it implementation-defined for now. Tested on x86_64-linux, ok for trunk? 2016-06-08 Marek Polacek <pola...@redhat.com> PR c/65471 * gcc.dg/c11-generic-3.c: New test. diff --git gcc/testsuite/gcc.dg/c11-generic-3.c gcc/testsuite/gcc.dg/c11-generic-3.c index e69de29..8bac21e 100644 --- gcc/testsuite/gcc.dg/c11-generic-3.c +++ gcc/testsuite/gcc.dg/c11-generic-3.c @@ -0,0 +1,10 @@ +/* Test C11 _Generic. Test we follow the resolution of DR#423. */ +/* { dg-do compile } */ +/* { dg-options "-std=c11 -pedantic-errors" } */ + +char const *a = _Generic ("bla", char *: ""); +char const *b = _Generic ("bla", char[4]: ""); /* { dg-error "not compatible with any association" } */ +char const *c = _Generic ((int const) { 0 }, int: ""); +char const *d = _Generic ((int const) { 0 }, int const: ""); /* { dg-error "not compatible with any association" } */ +char const *e = _Generic (+(int const) { 0 }, int: ""); +char const *f = _Generic (+(int const) { 0 }, int const: ""); /* { dg-error "not compatible with any association" } */ Marek