Created on 2007-10-17.00:00:00 last changed 130 months ago
[Voted into WP at August, 2010 meeting.]
Proposed resolution (February, 2010):
Change 11.9.3 [class.base.init] paragraph 7 as follows:
The expression-list or braced-init-list in a mem-initializer is used to initialize the
base class or non-static data member subobject denoted by the mem-initializer-iddesignated subobject (or, in the case of a delegating constructor, the complete class object) according to the initialization rules of 9.4 [dcl.init] for direct-initialization.[Example: ...
—end example] The initialization
of each base and memberperformed by each mem-initializer constitutes a full-expression...
Change 11.9.3 [class.base.init] paragraph 8 as follows:
IfIn a non-delegating constructor, if a given non-static data member or base class is not named by a mem-initializer-id...
Change 11.9.3 [class.base.init] paragraph 10 as follows:
InitializationIn a non-delegating constructor, initialization proceeds in the following order:
Change 11.9.3 [class.base.init] paragraph 12 as follows (this is an unrelated change correcting an error noticed while preparing the resolution of this issue):
Names in the expression-list or braced-init-list of a mem-initializer are evaluated in the scope of the constructor...
Change the next-to-last bullet of the note in 9.4.5 [dcl.init.list] paragraph 1 as follows:
as a base-or-member initializer in a
mem-initializer (11.9.3 [class.base.init])
Notes from the September, 2008 meeting:
This text was significantly modified by N2756 (nonstatic data member initializers) and needs to be reworked in light of those changes.
Proposed resolution (June, 2008):
Change 11.9.3 [class.base.init] paragraph 3 as follows:
The expression-list in a mem-initializer is used to initialize the base class or non-static data member subobject denoted by the mem-initializer-id. The semantics of a mem-initializer areA mem-initializer in which the mem-initializer-id names the constructor's class initializes the object by invoking the selected target constructor with the mem-initializer's expression-list. A mem-initializer in which the mem-initializer-id names a base class or non-static data member initializes the designated subobject as follows:
if the expression-list of the mem-initializer is omitted, the base class or member subobject is value-initialized (see 9.4 [dcl.init]);
otherwise, the subobject indicated by mem-initializer-id is direct-initialized using expression-list as the initializer (see 9.4 [dcl.init]).
...
The initialization
of each base and memberperformed by each mem-initializer constitutes a full-expression. Any expression...
The changes for delegating constructors overlooked the need to change 11.9.3 [class.base.init] paragraph 3:
The expression-list in a mem-initializer is used to initialize the base class or non-static data member subobject denoted by the mem-initializer-id. The semantics of a mem-initializer are as follows:
if the expression-list of the mem-initializer is omitted, the base class or member subobject is value-initialized (see 9.4 [dcl.init]);
otherwise, the subobject indicated by mem-initializer-id is direct-initialized using expression-list as the initializer (see 9.4 [dcl.init]).
The initialization of each base and member constitutes a full-expression. Any expression in a mem-initializer is evaluated as part of the full-expression that performs the initialization.
This paragraph deals only with subobjects; it needs to be made more general to apply to the complete object as well when the mem-initializer-id designates the constructor's class.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | status: wp -> fdis |
2010-11-29 00:00:00 | admin | set | status: dr -> wp |
2010-08-23 00:00:00 | admin | set | messages: + msg2919 |
2010-08-23 00:00:00 | admin | set | status: ready -> dr |
2010-03-29 00:00:00 | admin | set | status: review -> ready |
2010-02-16 00:00:00 | admin | set | messages: + msg2551 |
2010-02-16 00:00:00 | admin | set | status: drafting -> review |
2008-10-05 00:00:00 | admin | set | messages: + msg1783 |
2008-10-05 00:00:00 | admin | set | status: review -> drafting |
2008-06-29 00:00:00 | admin | set | messages: + msg1685 |
2008-06-29 00:00:00 | admin | set | status: drafting -> review |
2008-03-17 00:00:00 | admin | set | status: open -> drafting |
2007-10-17 00:00:00 | admin | create |