Bug 3991 – Void initializers in unions considered overlapping
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2010-03-20T10:06:00Z
Last change time
2014-02-15T02:18:48Z
Keywords
rejects-valid
Assigned to
nobody
Creator
matti.niemenmaa+dbugzilla
Comments
Comment #0 by matti.niemenmaa+dbugzilla — 2010-03-20T10:06:59Z
Each of the following unions give the same error:
arst.d(1): Error: union arst.X overlapping initialization for struct X.y
arst.d(5): Error: union arst.Y overlapping initialization for struct Y.y
arst.d(9): Error: union arst.Z overlapping initialization for struct Z.y
union X {
int x = void;
int y = void;
}
union Y {
int x = void;
int y = 0;
}
union Z {
int x = 0;
int y = void;
}
Removing the "= void", these unions compile (except, for some reason, Y, but that's a separate issue).
Comment #1 by github-bugzilla — 2013-11-16T00:59:20Z