CWG Issue 57 (original) (raw)

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-04-13


57. Empty unions

Section: 11.5 [class.union]Status: openSubmitter: Steve AdamczykDate: 13 Oct 1998

There doesn't seem to be a prohibition in 11.5 [class.union] against a declaration like

union { int : 0; } x;

Should that be valid? If so, 9.5 [dcl.init] paragraph 5 third bullet, which deals with default-initialization of unions, should say that no initialization is done if there are no data members.

What about:

union { } x;
static union { };

If the first example is well-formed, should either or both of these cases be well-formed as well?

(See also the resolution forissue 151.)

Notes from 10/00 meeting: The resolution toissue 178, which was accepted as a DR, addresses the first point above (default initialization). The other questions have not yet been decided, however.