1 // PR c++/66644
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wno-pedantic" }
4 
5 struct test1
6 {
7   union
8   {
9     struct { char a=0, b=0; };
10     char buffer[16];
11   };
12 };
13 
14 struct test2
15 {
16   union
17   {
18     struct { char a=0, b; };
19     char buffer[16];
20   };
21 };
22 
23 struct test3
24 {
25   union
26   {
27     struct { char a, b; } test2{0,0};
28     char buffer[16];
29   };
30 };
31 
32 struct test4
33 {
34   union
35   {   // { dg-error "multiple fields" }
36     struct { char a=0, b=0; };
37     struct { char c=0, d; };
38   };
39 };
40 
41 struct test5
42 {
43   union
44   {
45     union { char a=0, b=0; };  // { dg-error "multiple fields" }
46     char buffer[16];
47   };
48 };
49