Created on 2009-06-19.00:00:00 last changed 178 months ago
[Voted into WP at March, 2010 meeting.]
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
...
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
...
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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | messages: + msg2717 |
2010-03-29 00:00:00 | admin | set | status: tentatively ready -> cd2 |
2010-02-16 00:00:00 | admin | set | messages: + msg2504 |
2010-02-16 00:00:00 | admin | set | status: review -> tentatively ready |
2009-11-08 00:00:00 | admin | set | messages: + msg2381 |
2009-11-08 00:00:00 | admin | set | status: open -> review |
2009-06-19 00:00:00 | admin | create |