digitalmars.D.bugs - [Issue 13891] New: __gshared/static union members do not overlap
- via Digitalmars-d-bugs (34/34) Dec 25 2014 https://issues.dlang.org/show_bug.cgi?id=13891
https://issues.dlang.org/show_bug.cgi?id=13891 Issue ID: 13891 Summary: __gshared/static union members do not overlap Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: vlevenfeld gmail.com struct Foo { union { int a; int b; } } struct Bar { __gshared union { // also fails if __gshared -> static int a; int b; } } void main (string[] args) { Foo x; Bar y; assert (cast(uint)(&x.a) == cast(uint)(&x.b)); // PASS assert (cast(uint)(&y.a) == cast(uint)(&y.b)); // FAIL } --
Dec 25 2014