This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-08-20
[Voted into WP at March, 2010 meeting.]
The final set of declarations in the example following 9.4.5 [dcl.init.list] bullet 3.3 is:
struct S2 { int m1; double m2,m3; }; S2 s21 = { 1, 2, 3.0 }; // OK S2 s22 { 1.0, 2, 3 }; // error: narrowing S2 s23 {}; // OK: default to 0,0,0
However, S2 is an aggregate. Aggregates are handled in bullet 1, while bullet 3 deals with classes with constructors. This part of the example should be moved to the first bullet.
Proposed resolution (October, 2009):
Move the S2 example from bullet 3 to bullet 1 in 9.4.5 [dcl.init.list] paragraph 3:
If T is an aggregate, aggregate initialization is performed (9.4.2 [dcl.init.aggr]).
[Example:
double ad[] = { 1, 2.0 }; // OK int ai[] = { 1, 2.0 }; // error: narrowing struct S2 { int m1; double m2,m3; }; S2 s21 = { 1, 2, 3.0 }; // OK S2 s22 { 1.0, 2, 3 }; // error: narrowing S2 s23 {}; // OK: default to 0,0,0
—end example]
Otherwise, if T is a specialization...
Otherwise, if T is a class type...
[Example:
... S s3 { }; // OK: invoke #2struct S2 { int m1; double m2,m3; }; S2 s21 = { 1, 2, 3.0 }; // OK S2 s22 { 1.0, 2, 3 }; // error: narrowing S2 s23 {}; // OK: default to 0,0,0
—end example]
...