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

2024-10-26


1507. Value initialization with trivial inaccessible default constructor

Section: 9.4  [dcl.init]     Status: CD3     Submitter: Johannes Schaub     Date: 2012-06-01

[Moved to DR at the April, 2013 meeting.]

According to 9.4 [dcl.init] paragraph 7, a trivial default constructor is not used in value initialization, so the following example would appear to be well-formed:

  struct A { private: A() = default; };
  int main() { A(); }

Proposed resolution (February, 2013):

  1. Change 9.4 [dcl.init] paragraph 7 as follows:

  2. To default-initialize an object of type T means:

  3. Change 9.4 [dcl.init] paragraph 8 as follows:

  4. To value-initialize an object of type T means: