D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3991 - Void initializers in unions considered overlapping
Summary: Void initializers in unions considered overlapping
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2010-03-20 10:06 UTC by Matti Niemenmaa
Modified: 2014-02-15 02:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Matti Niemenmaa 2010-03-20 10:06:59 UTC
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 github-bugzilla 2013-11-16 00:59:20 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e8a53272d3d3406b36fdf7caff61f79e888c708c
fix Issue 3991 - Void initializers in unions considered overlapping
Comment 2 Kenji Hara 2013-11-16 02:04:10 UTC
Worksforme in D2 with test case, and D1 is not supported anymore.