digitalmars.D.bugs - [Issue 20342] New: GDC - assignment to anonymous union member
- d-bugmail puremagic.com (37/37) Oct 30 2019 https://issues.dlang.org/show_bug.cgi?id=20342
https://issues.dlang.org/show_bug.cgi?id=20342 Issue ID: 20342 Summary: GDC - assignment to anonymous union member corrupts data Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: sahmi.soulaimane gmail.com ``` union U { struct { size_t a; size_t b; union { size_t c; size_t d; } } } void main() { U u; assert(u.a == 0); // ok u.d = 1; assert(u.a == 0); // error } ``` --
Oct 30 2019