aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr113492.c
blob: 56296c510727cbc084bda6a0d7b58c657a94cc2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* PR 113492
 * { dg-do compile }
 * { dg-options "-std=c23 -funsigned-bitfields" } */

struct foo {
	int i : 3;
} i;

void test()
{
	struct foo {
		unsigned i : 3;
	} u;

	1 ? i : u;
	1 ? u : i;
}
	
struct bar {
	unsigned i : 3;
} u;

void test2()
{
	struct bar {
		int i : 3;
	} i;

	1 ? i : u;
	1 ? u : i;
}
	
void test3()
{
	typedef int myint;
	struct bar {
		myint i : 3;
	} i;

	1 ? i : u;
	1 ? u : i;
}