This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-10-26
[Voted into the WP at the November, 2010 meeting.]
Issue 990 added the following text to 9.4.5 [dcl.init.list] paragraph 3:Otherwise, if the initializer list has no elements and T is an aggregate, each of the members of T is initialized from an empty initializer list. [Example:...
A better way to handle this would be to delete that bullet and change 9.4.2 [dcl.init.aggr] paragraph 7 as follows:
If there are fewer initializer-clauses in the list than there are members in the aggregate, then each member not explicitly initialized shall bevalue-initialized (9.4 [dcl.init])initialized from an empty initializer list (9.4.5 [dcl.init.list]).
This makes { } less of a special case and makes the following example work:
struct A { A(std::initializer_list<int>); }; struct B { int i; A a; }; B b = { 1 };
Proposed resolution (August, 2010):
Delete 9.4.5 [dcl.init.list] bullet 3.2, includeing the example:
Change 9.4.2 [dcl.init.aggr] paragraph 7 as follows:
If there are fewer initializer-clauses in the list than there are members in the aggregate, then each member not explicitly initialized shall bevalue-initialized (9.4 [dcl.init])initialized from an empty initializer list (9.4.5 [dcl.init.list]).