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
Comment #1 by robert.schadek — 2024-12-13T19:37:52Z