Open
Description
Nick Treleaven reported this on 2024-10-05T16:35:25Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=24797
Description
The fix for issue 24776 does not catch cases like this:
union U3
{
int y;
struct {
float z, w; // z ignored, but w has a different offset to y
}
}
static assert(__traits(isZeroInit, U3)); // fails
Using `StructDeclaration.members` rather than `fields` may be necessary as a fallback when there are overlapped fields - see:
https://github.com/dlang/dmd/pull/16858#discussion_r1769869617