Title
Unintended copy initialization with designated initializers
Status
cd5
Section
9.4.2 [dcl.init.aggr]
Submitter
Zhihao Yuan

Created on 2017-10-06.00:00:00 last changed 47 months ago

Messages

Date: 2018-04-11.00:00:00

Proposed resolution, April, 2018:

Change 9.4.2 [dcl.init.aggr] bullet 4.2 as follows:

Otherwise, the element is copy-initialized from the corresponding initializer-clause or is initialized with the brace-or-equal-initializer of the corresponding designated-initializer-clause.
Date: 2018-06-15.00:00:00

[Accepted at the June, 2018 (Rapperswil) meeting.]

According to 9.4.2 [dcl.init.aggr] bullet 4.2,

Otherwise, the element is copy-initialized from the corresponding initializer-clause or the brace-or-equal-initializer of the corresponding designated-initializer-clause.

This sounds as if the initialization performed by a designated initializer is always copy-initialization. However, it was intended that the kind of initialization match the form of the initializer, i.e., a designated-initializer-clause of the form

  { .x{3} }

was intended to perform direct-initialization.

History
Date User Action Args
2020-12-15 00:00:00adminsetstatus: tentatively ready -> cd5
2018-04-11 00:00:00adminsetmessages: + msg6184
2017-10-06 00:00:00admincreate