@@ -63,7 +63,7 @@ C c = {
63
63
.x = 1 , // override-note {{previous}}
64
64
.x = 1 , // override-error {{overrides prior initialization}} override-note {{previous}}
65
65
.y = 1 , // override-note {{previous}}
66
- .y = 1 , // override-error {{overrides prior initialization}}
66
+ .y = 1 , // override-error {{overrides prior initialization}} // reorder-note {{previous initialization for field 'y' is here}}
67
67
.x = 1 , // reorder-error {{declaration order}} override-error {{overrides prior initialization}} override-note {{previous}}
68
68
.x = 1 , // override-error {{overrides prior initialization}}
69
69
};
@@ -156,3 +156,43 @@ namespace deduction {
156
156
j3<D, E>({}); // ok, selects E overload by SFINAE (too many braces for D)
157
157
}
158
158
}
159
+
160
+ namespace GH63605 {
161
+ struct A {
162
+ unsigned x;
163
+ unsigned y;
164
+ unsigned z;
165
+ };
166
+
167
+ struct B {
168
+ unsigned a;
169
+ unsigned b;
170
+ };
171
+
172
+ struct : public A , public B {
173
+ unsigned : 2 ;
174
+ unsigned a : 6 ;
175
+ unsigned : 1 ;
176
+ unsigned b : 6 ;
177
+ unsigned : 2 ;
178
+ unsigned c : 6 ;
179
+ unsigned d : 1 ;
180
+ unsigned e : 2 ;
181
+ } data = {
182
+ {.z =0 ,
183
+ // pedantic-note@-1 {{first non-designated initializer is here}}
184
+ // reorder-note@-2 {{previous initialization for field 'z' is here}}
185
+ .y =1 , // reorder-error {{field 'z' will be initialized after field 'y'}}
186
+ // reorder-note@-1 {{previous initialization for field 'y' is here}}
187
+ .x =2 }, // reorder-error {{field 'y' will be initialized after field 'x'}}
188
+ {.b =3 , // reorder-note {{previous initialization for field 'b' is here}}
189
+ .a =4 }, // reorder-error {{field 'b' will be initialized after field 'a'}}
190
+ .e = 1 , // reorder-note {{previous initialization for field 'e' is here}}
191
+ // pedantic-error@-1 {{mixture of designated and non-designated initializers in the same initializer list is a C99 extension}}
192
+ .d = 1 , // reorder-error {{field 'e' will be initialized after field 'd'}}
193
+ // reorder-note@-1 {{previous initialization for field 'd' is here}}
194
+ .c = 1 , // reorder-error {{field 'd' will be initialized after field 'c'}} // reorder-note {{previous initialization for field 'c' is here}}
195
+ .b = 1 , // reorder-error {{field 'c' will be initialized after field 'b'}} // reorder-note {{previous initialization for field 'b' is here}}
196
+ .a = 1 , // reorder-error {{field 'b' will be initialized after field 'a'}}
197
+ };
198
+ }
0 commit comments