Title
Initialization not specified for forwarding constructors
Status
c++11
Section
11.9.3 [class.base.init]
Submitter
Alisdair Meredith

Created on 2007-10-17.00:00:00 last changed 96 months ago

Messages

Date: 2010-08-23.00:00:00

[Voted into WP at August, 2010 meeting.]

Date: 2010-02-15.00:00:00

Proposed resolution (February, 2010):

  1. Change 11.9.3 [class.base.init] paragraph 7 as follows:

  2. 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-id designated 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 member performed by each mem-initializer constitutes a full-expression...

  3. Change 11.9.3 [class.base.init] paragraph 8 as follows:

  4. If In a non-delegating constructor, if a given non-static data member or base class is not named by a mem-initializer-id...
  5. Change 11.9.3 [class.base.init] paragraph 10 as follows:

  6. Initialization In a non-delegating constructor, initialization proceeds in the following order:
  7. 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):

  8. Names in the expression-list or braced-init-list of a mem-initializer are evaluated in the scope of the constructor...
  9. 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])

Date: 2008-09-15.00:00:00

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.

Date: 2008-06-15.00:00:00

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 are A 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 member performed by each mem-initializer constitutes a full-expression. Any expression...

Date: 2007-10-17.00:00:00

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:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetstatus: wp -> fdis
2010-11-29 00:00:00adminsetstatus: dr -> wp
2010-08-23 00:00:00adminsetmessages: + msg2919
2010-08-23 00:00:00adminsetstatus: ready -> dr
2010-03-29 00:00:00adminsetstatus: review -> ready
2010-02-16 00:00:00adminsetmessages: + msg2551
2010-02-16 00:00:00adminsetstatus: drafting -> review
2008-10-05 00:00:00adminsetmessages: + msg1783
2008-10-05 00:00:00adminsetstatus: review -> drafting
2008-06-29 00:00:00adminsetmessages: + msg1685
2008-06-29 00:00:00adminsetstatus: drafting -> review
2008-03-17 00:00:00adminsetstatus: open -> drafting
2007-10-17 00:00:00admincreate