https://issues.dlang.org/show_bug.cgi?id=24045
Issue ID: 24045
Summary: Compiler fails to recognize overlapping Union elements
in CTFE
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
enum bool bar = foo(42);
bool foo(ubyte c) {
union U {
uint a;
ubyte[4] b;
}
U u;
u.b[0] = c;
assert (u.a == c, "This should never happen");
return true;
}
--
