Title
Copy-initialization in member initialization
Status
cd4
Section
9.4 [dcl.init]
Submitter
Vinny Romano

Created on 2013-03-04.00:00:00 last changed 49 months ago

Messages

Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

Date: 2013-04-15.00:00:00

Proposed resolution (April, 2013):

Change 9.4 [dcl.init] paragraphs 15-16 as follows, removing the example in paragraph 15 and making it a single running sentence:

The initialization that occurs in the = form of a brace-or-equal-initializer or condition (8.5 [stmt.select]),

  T x = a;

as well as in argument passing, function return, throwing an exception (14.2 [except.throw]), handling an exception (14.4 [except.handle]), and aggregate member initialization (9.4.2 [dcl.init.aggr]), is called copy-initialization. [Note: Copy-initialization may invoke a move (12.8). —end note]

The initialization that occurs in the forms

  T x(a);
  T x{a};

as well as in new expressions (7.6.2.8 [expr.new]), static_cast expressions (5.2.9), functional notation type conversions (7.6.1.4 [expr.type.conv]), and base and member initializers mem-initializers (11.9.3 [class.base.init]), and the braced-init-list form of a condition is called direct-initialization.

Date: 2013-03-04.00:00:00

According to 9.4 [dcl.init] paragraph 16,

The initialization that occurs in the forms

  T x(a);
  T x{a};

as well as in new expressions (7.6.2.8 [expr.new]), static_cast expressions (7.6.1.9 [expr.static.cast]), functional notation type conversions (7.6.1.4 [expr.type.conv]), and base and member initializers (11.9.3 [class.base.init]) is called direct-initialization.

This wording was overlooked when brace-or-equal-initializers were added to the language, permitting copy-initialization of members by use of the = form.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5381
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-07-07 00:00:00adminsetstatus: review -> ready
2013-05-03 00:00:00adminsetmessages: + msg4320
2013-05-03 00:00:00adminsetstatus: open -> review
2013-03-04 00:00:00admincreate