This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
[Voted into WP at March, 2010 meeting.]
According to 11.4.5 [class.ctor] paragraph 5,
An implicitly-declared default constructor for class X is defined as deleted if: ... any non-static data member of const-qualified type (or array thereof) does not have a user-provided default constructor, or...
It is not clear if this adequately covers the case in which some variant members are const-qualified but others are not. The intent of the restriction is to prevent creation of an object with uninitialized members that would require a const_cast to set their value later, but const-qualified members of an anonymous union in which other members are not const do not seem to present that problem.
Proposed resolution (October, 2009):
Change 11.4.5 [class.ctor] bullet 5.3 of the second list and add a fourth bullet as follows:
...
any non-variant non-static data member of
const-qualified type (or array thereof) does not have a user-provided
default constructor, or
all variant members are of const-qualified type (or array thereof), or
...
Proposed resolution (November, 2009):
Change 11.4.5 [class.ctor] bullet 5.3 of the second list and add two bullets as follows:
...
any non-variant non-static data member of
const-qualified type (or array thereof) does not have a user-provided
default constructor, or
X is a union and all its variant members are of const-qualified type (or array thereof),
X is a non-union class and all members of any anonymous union member are of const-qualified type (or array thereof), or
...