We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cd22832 + 3c39f17 commit 0a90480Copy full SHA for 0a90480
spec/struct.dd
@@ -204,14 +204,12 @@ $(H2 $(LNAME2 default_union_init, Default Initialization of Unions))
204
---
205
union U { int a = 4; long b; }
206
U x; // x.a is set to 4, x.b to an implementation-defined value
207
-
208
- union V { int a; long b = 4; }
209
- V y; // y.a is set to 0, y.b to an implementation-defined value
210
211
)
212
213
$(SPEC_RUNNABLE_EXAMPLE_FAIL
214
+ union V { int a; long b = 4; } // error: union field `b` with default initialization `4` must be before field `a`
215
union W { int a = 4; long b = 5; } // error: overlapping default initialization for `a` and `b`
216
217
0 commit comments