]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/c11-qual-1.c
f731e068830348da71208bdebd4d314f24c1b502
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c11-qual-1.c
1 /* Test that qualifiers are lost in tertiary operator for pointers to arrays before C2X, PR98397 */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c11 -pedantic-errors -Wno-discarded-array-qualifiers" } */
4
5 void foo(void)
6 {
7 const int (*u)[1];
8 void *v;
9 _Static_assert(_Generic(1 ? u : v, const void*: 0, void*: 1), "qualifier not lost");
10 _Static_assert(_Generic(1 ? v : u, const void*: 0, void*: 1), "qualifier not lost");
11 }