aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C
blob: 1dfa449a8d289ba4b9d37c694a9896929de74123 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// PR c++/39475

struct I; // { dg-message "forward declaration" }
struct C { };
union U; // { dg-message "forward declaration" }

bool nas1 = __has_nothrow_assign(I); // { dg-error "incomplete type" }
bool nas2 = __has_nothrow_assign(C[]);
bool nas3 = __has_nothrow_assign(I[]);
bool nas4 = __has_nothrow_assign(void);
bool nas5 = __has_nothrow_assign(const void);

bool tas1 = __has_trivial_assign(I); // { dg-error "incomplete type" }
bool tas2 = __has_trivial_assign(C[]);
bool tas3 = __has_trivial_assign(I[]);
bool tas4 = __has_trivial_assign(void);
bool tas5 = __has_trivial_assign(const void);

bool nco1 = __has_nothrow_constructor(I); // { dg-error "incomplete type" }
bool nco2 = __has_nothrow_constructor(C[]);
bool nco3 = __has_nothrow_constructor(I[]);
bool nco4 = __has_nothrow_constructor(void);
bool nco5 = __has_nothrow_constructor(const void);

bool tco1 = __has_trivial_constructor(I); // { dg-error "incomplete type" }
bool tco2 = __has_trivial_constructor(C[]);
bool tco3 = __has_trivial_constructor(I[]);
bool tco4 = __has_trivial_constructor(void);
bool tco5 = __has_trivial_constructor(const void);

bool ncp1 = __has_nothrow_copy(I); // { dg-error "incomplete type" }
bool ncp2 = __has_nothrow_copy(C[]);
bool ncp3 = __has_nothrow_copy(I[]);
bool ncp4 = __has_nothrow_copy(void);
bool ncp5 = __has_nothrow_copy(const void);

bool tcp1 = __has_trivial_copy(I); // { dg-error "incomplete type" }
bool tcp2 = __has_trivial_copy(C[]);
bool tcp3 = __has_trivial_copy(I[]);
bool tcp4 = __has_trivial_copy(void);
bool tcp5 = __has_trivial_copy(const void);

bool tde1 = __has_trivial_destructor(I); // { dg-error "incomplete type" }
bool tde2 = __has_trivial_destructor(C[]);
bool tde3 = __has_trivial_destructor(I[]);
bool tde4 = __has_trivial_destructor(void);
bool tde5 = __has_trivial_destructor(const void);

// T shall be a complete type, cv void, or an array of unknown bound.

bool con1 = __is_constructible(C);
bool con2 = __is_constructible(I); // { dg-error "incomplete type" }
bool con3 = __is_constructible(U); // { dg-error "incomplete type" }
bool con4 = __is_constructible(C[]);
bool con5 = __is_constructible(I[]);
bool con6 = __is_constructible(U[]);
bool con7 = __is_constructible(C[1]);
bool con8 = __is_constructible(I[1]); // { dg-error "incomplete type" }
bool con9 = __is_constructible(U[1]); // { dg-error "incomplete type" }
bool con10 = __is_constructible(void);
bool con11 = __is_constructible(const void);

// If T is a non-union class type, T shall be a complete type.

bool vde1 = __has_virtual_destructor(I); // { dg-error "incomplete type" }
bool vde2 = __has_virtual_destructor(U);
bool vde3 = __has_virtual_destructor(C[]);
bool vde4 = __has_virtual_destructor(I[]);
bool vde5 = __has_virtual_destructor(U[]);
bool vde6 = __has_virtual_destructor(C[1]);
bool vde7 = __has_virtual_destructor(I[1]);
bool vde8 = __has_virtual_destructor(U[1]);
bool vde9 = __has_virtual_destructor(void);
bool vde10 = __has_virtual_destructor(const void);

bool abs1 = __is_abstract(I); // { dg-error "incomplete type" }
bool abs2 = __is_abstract(U);
bool abs3 = __is_abstract(C[]);
bool abs4 = __is_abstract(I[]);
bool abs5 = __is_abstract(U[]);
bool abs6 = __is_abstract(C[1]);
bool abs7 = __is_abstract(I[1]);
bool abs8 = __is_abstract(U[1]);
bool abs9 = __is_abstract(void);
bool abs10 = __is_abstract(const void);

bool emp1 = __is_empty(I); // { dg-error "incomplete type" }
bool emp2 = __is_empty(U);
bool emp3 = __is_empty(C[]);
bool emp4 = __is_empty(I[]);
bool emp5 = __is_empty(U[]);
bool emp6 = __is_empty(C[1]);
bool emp7 = __is_empty(I[1]);
bool emp8 = __is_empty(U[1]);
bool emp9 = __is_empty(void);
bool emp10 = __is_empty(const void);

bool pol1 = __is_polymorphic(I); // { dg-error "incomplete type" }
bool pol2 = __is_polymorphic(U);
bool pol3 = __is_polymorphic(C[]);
bool pol4 = __is_polymorphic(I[]);
bool pol5 = __is_polymorphic(U[]);
bool pol6 = __is_polymorphic(C[1]);
bool pol7 = __is_polymorphic(I[1]);
bool pol8 = __is_polymorphic(U[1]);
bool pol9 = __is_polymorphic(void);
bool pol10 = __is_polymorphic(const void);

// If T is a class type, T shall be a complete type.

bool agg1 = __is_aggregate(I); // { dg-error "incomplete type" }
bool agg2 = __is_aggregate(U); // { dg-error "incomplete type" }
bool agg3 = __is_aggregate(C[]);
bool agg4 = __is_aggregate(I[]);
bool agg5 = __is_aggregate(U[]);
bool agg6 = __is_aggregate(C[1]);
bool agg7 = __is_aggregate(I[1]);
bool agg8 = __is_aggregate(U[1]);
bool agg9 = __is_aggregate(void);
bool agg10 = __is_aggregate(const void);

bool fin1 = __is_final(I); // { dg-error "incomplete type" }
bool fin2 = __is_final(U); // { dg-error "incomplete type" }
bool fin3 = __is_final(C[]);
bool fin4 = __is_final(I[]);
bool fin5 = __is_final(U[]);
bool fin6 = __is_final(C[1]);
bool fin7 = __is_final(I[1]);
bool fin8 = __is_final(U[1]);
bool fin9 = __is_final(void);
bool fin10 = __is_final(const void);

// remove_all_extents_t<T> shall be a complete type or cv void.

bool pod1 = __is_pod(I); // { dg-error "incomplete type" }
bool pod2 = __is_pod(U); // { dg-error "incomplete type" }
bool pod3 = __is_pod(C[]);
bool pod4 = __is_pod(I[]); // { dg-error "incomplete type" }
bool pod5 = __is_pod(U[]); // { dg-error "incomplete type" }
bool pod6 = __is_pod(C[1]);
bool pod7 = __is_pod(I[1]); // { dg-error "incomplete type" }
bool pod8 = __is_pod(U[1]); // { dg-error "incomplete type" }
bool pod9 = __is_pod(void);
bool pod10 = __is_pod(const void);