aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr101172.c
blob: b9d098bb64445917408a47238b92ed48976b6a3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR middle-end/101172 */
/* { dg-do compile } */
/* { dg-options "-O2" } */

union U
{
  int a[3];
  struct
  {
    int a : 3;
    struct this_struct var;	/* { dg-error "field 'var' has incomplete type" } */
  } b;
};

const union U hello = {.a = {1, 2, 3}};

void foo()
{
  int x = hello.b.a;
}