Skip to content

Commit 3c39f17

Browse files
committed
spec/struct.dd: Move incorrect initialization of union to SPEC_RUNNABLE_EXAMPLE_FAIL
1 parent cd22832 commit 3c39f17

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

spec/struct.dd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,12 @@ $(H2 $(LNAME2 default_union_init, Default Initialization of Unions))
204204
---
205205
union U { int a = 4; long b; }
206206
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
210207
---
211208
)
212209

213210
$(SPEC_RUNNABLE_EXAMPLE_FAIL
214211
---
212+
union V { int a; long b = 4; } // error: union field `b` with default initialization `4` must be before field `a`
215213
union W { int a = 4; long b = 5; } // error: overlapping default initialization for `a` and `b`
216214
---
217215
)

0 commit comments

Comments
 (0)