struct S6 { union { int i1; float f1; } } static assert(__traits(isZeroInit, S6)); // fails S6.init should be zero - `{ S6.i1.init }` according to: https://dlang.org/spec/property.html#init PR incoming.
@ntrel created dlang/dmd pull request #16858 "Fix Bugzilla 24776 - Struct with anonymous union has wrong isZeroInit" fixing this issue: - Fix Bugzilla 24776 - Struct with anonymous union has wrong isZeroInit https://github.com/dlang/dmd/pull/16858
dlang/dmd pull request #16858 "Fix: isZeroInit does not take into account unions" was merged into master: - cbb7cb6f3cd2eeed05aca8a2853c17e8829d0d2c by Nick Treleaven: Bugzilla 24776 - Struct with anonymous union has wrong isZeroInit - 179da5d3266fed3e9b3cbd65bf377d4149b31529 by Nick Treleaven: Fix Bugzilla 24776 - Struct with anonymous union has wrong isZeroInit https://github.com/dlang/dmd/pull/16858