PR c++/67273
[official-gcc.git] / gcc / testsuite / g++.dg / parse / pr58664.C
blob489259a14a366eb198ec65cb317542e108ffbf7a
1 // PR c++/58664
2 // { dg-do compile { target c++11 } }
4 struct F;          // { dg-message "forward declaration" }
6 union U            // { dg-message "not complete" }
8   U u;             // { dg-error "field 'u' has incomplete type 'U'" }
9 };
11 union CU           // { dg-message "not complete" }
13   const CU u;      // { dg-error "incomplete type" }
16 template<typename T>
17 union UT           // { dg-message "not complete" }
19   UT u;            // { dg-error "incomplete type" }
22 template union UT<int>;
24 union UF
26   F u;             // { dg-error "field 'u' has incomplete type 'F'" }
29 template<typename T>
30 union UFT
32   F u;             // { dg-error "incomplete type" }
35 template union UFT<int>;
37 struct S           // { dg-message "not complete" }
39   S s;             // { dg-error "field 's' has incomplete type 'S'" }
42 struct VS          // { dg-message "not complete" }
44   volatile VS s;   // { dg-error "incomplete type" }
47 template<typename T>
48 struct ST          // { dg-message "not complete" }
50   ST s;            // { dg-error "incomplete type" }
53 template class ST<int>;
55 struct SF
57   F s;             // { dg-error "field 's' has incomplete type 'F'" }
60 template<typename T>
61 struct SFT
63   F s;             // { dg-error "incomplete type" }
66 template class SFT<int>;