Issue2272

Title 2272. Implicit initialization of aggregate members of reference type
Status c++17 Section 11.6.1 [dcl.init.aggr]
Submitter Vinny Romano

Created on 2016-06-10.00:00:00 by admin, last changed by admin.

Messages
msg6127 (view) Date: 2017-02-15.00:00:00

Proposed resolution (February, 2017):

  1. Change 11.6.1 [dcl.init.aggr] paragraph 8 as follows:

  2. If there are fewer initializer-clauses in the list than there are elements in the a non-union aggregate, then each element not explicitly initialized shall be initialized from its default member initializer (12.2 [class.mem]) or, if there is no default member initializer, from an empty initializer list (11.6.4 [dcl.init.list]). is initialized as follows:

    • If the element has a default member initializer (12.2 [class.mem]), the element is initialized from that initializer.

    • Otherwise, if the element is not a reference, the element is copy-initialized from an empty initializer list (11.6.4 [dcl.init.list]).

    • Otherwise, the program is ill-formed.

    If the aggregate is a union and the initializer list is empty, then

    • if any variant member has a default member initializer, that member is initialized from its default member initializer;

    • otherwise, the first member of the union (if any) is copy-initialized from an empty initializer list.

    [Example:...

  3. Delete 11.6.1 [dcl.init.aggr] paragraph 11:

  4. If an incomplete or empty initializer-list leaves a member of reference type uninitialized, the program is ill-formed.

This resolution also resolves issue 1622.

msg5905 (view) Date: 2017-02-15.00:00:00

[Adopted at the February/March, 2017 meeting.]

[Detailed description pending.]

History
Date User Action Args
2018-02-27 00:00:00adminsetstatus: open -> c++17
section: 8.6.1 [dcl.init.aggr] -> 11.6.1 [dcl.init.aggr]
2018-02-27 00:00:00adminsetmessages: + msg6127
2016-06-10 00:00:00admincreate