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

2024-12-06


1359. constexpr union constructors

Section: 9.2.6  [dcl.constexpr]     Status: CD3     Submitter: Richard Smith     Date: 2011-08-16

[Moved to DR at the October, 2012 meeting.]

A constexpr constructor is required to initialize all non-static data members (9.2.6 [dcl.constexpr] paragraph 4), which conflicts with the requirement that a constructor for a union is permitted to initialize only a single non-static data member (11.9.3 [class.base.init] paragraph 8).

Proposed resolution (February, 2012):

Change 9.2.6 [dcl.constexpr] paragraph 4 as follows:

In a definition of a constexpr constructor, each of the parameter types shall be a literal type. In addition, either its function-body shall be = delete or = default or it shall satisfy the following constraints: