[Bug 210] [REG] Comparing identical unions with alignment holes may start failing
via D.gnu
d.gnu at puremagic.com
Sun Feb 7 08:55:19 PST 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=210
Johannes Pfau <johannespfau at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |johannespfau at gmail.com
--- Comment #1 from Johannes Pfau <johannespfau at gmail.com> ---
> No, comparing Bar b1 == Bar b2 will not succeed in your case. Yes, this is different from dmd. Should it be considered a bug/regression? I don't mind reverting this for unions, but it might not always be correct anyway...
You're right. I didn't realize we can't actually compare unions in any other
way. For the record: As we don't know the 'active' union field we can't do
field-by-field comparisons of unions. So the only meaningful way to compare
unions is by memcmp. And then we'd have to fill the 'holes' in structs again...
I don't know if this corner-case is important enough to really worry about
this.
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20160207/bfbd0718/attachment.html>
More information about the D.gnu
mailing list