comparison gcc/testsuite/g++.dg/ext/flexary5.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
60 // Class with non-static data members and at least one base class 60 // Class with non-static data members and at least one base class
61 // with such a member is not a standard layout class. The warning 61 // with such a member is not a standard layout class. The warning
62 // below is benign since GCC computes the expected value. 62 // below is benign since GCC computes the expected value.
63 struct D5: E1, E2, NE { char a[]; }; 63 struct D5: E1, E2, NE { char a[]; };
64 64
65 ASSERT_AT_END (D5, a); // { dg-warning "offsetof within non-standard-layout" } 65 ASSERT_AT_END (D5, a); // { dg-warning "'offsetof' within non-standard-layout" }
66 66
67 struct A2x_1 { 67 struct A2x_1 {
68 size_t n; 68 size_t n;
69 size_t a[]; // { dg-error "not at end of .struct D6." } 69 size_t a[]; // { dg-error "not at end of .struct D6." }
70 }; 70 };
164 } a[]; 164 } a[];
165 }; 165 };
166 166
167 struct D22: A5x, E1, E2 { }; 167 struct D22: A5x, E1, E2 { };
168 168
169 ASSERT_AT_END (D22, a); // { dg-warning "offsetof within non-standard-layout" } 169 ASSERT_AT_END (D22, a); // { dg-warning "'offsetof' within non-standard-layout" }
170 170
171 struct D23: E1, A5x, E2 { }; 171 struct D23: E1, A5x, E2 { };
172 172
173 ASSERT_AT_END (D23, a); // { dg-warning "offsetof within non-standard-layout" } 173 ASSERT_AT_END (D23, a); // { dg-warning "'offsetof' within non-standard-layout" }
174 174
175 struct D24: E1, E2, A5x { }; 175 struct D24: E1, E2, A5x { };
176 176
177 ASSERT_AT_END (D24, a); // { dg-warning "offsetof within non-standard-layout" } 177 ASSERT_AT_END (D24, a); // { dg-warning "'offsetof' within non-standard-layout" }
178 178
179 struct DA5x: A5x { }; 179 struct DA5x: A5x { };
180 180
181 struct D25: DA5x, E1, E2 { }; 181 struct D25: DA5x, E1, E2 { };
182 182
183 ASSERT_AT_END (D25, a); // { dg-warning "offsetof within non-standard-layout" } 183 ASSERT_AT_END (D25, a); // { dg-warning "'offsetof' within non-standard-layout" }
184 184
185 struct D26: E1, DA5x, E2 { }; 185 struct D26: E1, DA5x, E2 { };
186 186
187 ASSERT_AT_END (D26, a); // { dg-warning "offsetof within non-standard-layout" } 187 ASSERT_AT_END (D26, a); // { dg-warning "'offsetof' within non-standard-layout" }
188 188
189 struct D27: E1, E2, DA5x { }; 189 struct D27: E1, E2, DA5x { };
190 190
191 ASSERT_AT_END (D27, a); // { dg-warning "offsetof within non-standard-layout" } 191 ASSERT_AT_END (D27, a); // { dg-warning "'offsetof' within non-standard-layout" }
192 192
193 // Verfify that a flexible array member is diagnosed even when deep 193 // Verfify that a flexible array member is diagnosed even when deep
194 // in the base class hierarchy. 194 // in the base class hierarchy.
195 struct A6x { 195 struct A6x {
196 size_t n; 196 size_t n;