[Issue 19917] unions should require that all members are `= void` initialised

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 4 16:20:58 UTC 2019


Andrei Alexandrescu <andrei at erdani.com> changed:

           What    |Removed                     |Added
                 CC|                            |andrei at erdani.com

--- Comment #7 from Andrei Alexandrescu <andrei at erdani.com> ---
That's excessive. Pasting from https://issues.dlang.org/show_bug.cgi?id=19919:

I think the principle of maximum simplicity goes like this:

* Only the first field can have an initializer (if you want another field...
move it to the top).
* If that initializer is "= void", the union is void-initialized.

All else is in error. That's that. Doesn't prevent any work getting done and is
simple to spec and implement.


More information about the Digitalmars-d-bugs mailing list