Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/nsdmi-union6.C

raw
1 // PR c++/58664
2 // { dg-do compile { target c++11 } }
3
4 struct F; // { dg-message "forward declaration" }
5
6 union U // { dg-message "not complete" }
7 {
8 U u[1] = { 0 }; // { dg-error "5:field .u. has incomplete type" }
9 };
10
11 template<typename T>
12 union UT // { dg-message "not complete" }
13 {
14 UT u[1] = { 0 }; // { dg-error "incomplete type" }
15 };
16
17 template union UT<int>;
18
19 union UF
20 {
21 F u[1] = { 0 }; // { dg-error "5:field .u. has incomplete type" }
22 };
23
24 template<typename T>
25 union UFT
26 {
27 F u[1] = { 0 }; // { dg-error "5:field .u. has incomplete type" }
28 };
29
30 template union UFT<int>;
31
32 struct S // { dg-message "not complete" }
33 {
34 S s[1] = { 0 }; // { dg-error "5:field .s. has incomplete type" }
35 };
36
37 template<typename T>
38 struct ST // { dg-message "not complete" }
39 {
40 ST s[1] = { 0 }; // { dg-error "incomplete type" }
41 };
42
43 template class ST<int>;
44
45 struct SF
46 {
47 F s[1] = { 0 }; // { dg-error "5:field .s. has incomplete type" }
48 };
49
50 template<typename T>
51 struct SFT
52 {
53 F s[1] = { 0 }; // { dg-error "5:field .s. has incomplete type" }
54 };
55
56 template class SFT<int>;