aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-qual-7.c
blob: 5fe15e1d2cbb3fb86a56bdb6d68be03f54ba66ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Tests related to qualifiers and pointers to arrays in C2X, PR98397 */
/* { dg-do compile } */
/* { dg-options "-std=c2x -pedantic-errors" } */

/* test that _Atomic qualifier is not preserved in tertiary operator for pointers to arrays in C2X */

void f(void)
{
	_Atomic void *u;
	void *v;
	_Static_assert(_Generic(1 ? u : v, _Atomic void*: 0, void*: 1), "_Atomic should be removed");
	_Static_assert(_Generic(1 ? v : u, _Atomic void*: 0, void*: 1), "_Atomic should be removed");
}