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


2394. Const-default-constructible for members

Section: 11.4.5.2  [class.default.ctor]     Status: CD5     Submitter: Richard Smith     Date: 2018-07-10

[Accepted as a DR at the February, 2019 meeting.]

After the changes for comment RU 1 in P0490R0, a defaulted default constructor is acceptable for default initialization of a const object under certain circumstances; for example,

   struct A {};
   const A a;

is well-formed. However, default-initialization of such a class member still requires a user-provided constructor:

   struct B { const A a; };
   B b;   //error

Proposed resolution (November, 2018):

Change 11.4.5.2 [class.default.ctor] bullet 2.4 as follows:

A defaulted default constructor for class X is defined as deleted if: