https://issues.dlang.org/show_bug.cgi?id=23841
Issue ID: 23841
Summary: isZeroInit does not take into account unions
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P4
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
```
union U
{
float x = 0;
float y;
}
static assert(__traits(isZeroInit, U)); // fails
```
It also wastes bytes in the binary because it emits `U.init` in .rodata instead
of .bss.
Workaround: add `=void` to void initialize the other union members.
--