This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115f. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-06


1501. Nested braces in list-initialization

Section: 9.4.5  [dcl.init.list]     Status: NAD     Submitter: Steve Adamczyk     Date: 2012-05-04

The specification of list-initialization in 9.4.5 [dcl.init.list] paragraph 3 has a bullet that reads,

Otherwise, if the initializer list has a single element of type E and either T is not a reference type or its referenced type is reference-related to E, the object or reference is initialized from that element

It is not clear what is meant by being “ initialized from the element.” If one assumes that it means “go back to 9.4 [dcl.init] and follow the logic ladder there with the element,” the logical result is that an initializer for a scalar could be arbitrarily deeply nested in braces, with each trip through the 9.4 [dcl.init] / 9.4.5 [dcl.init.list] recursion peeling off one layer. Presumably that is not intended.

Rationale (October, 2012):

The wording “a single element of type E” excludes the case of a nested braced initializer, because such an element has no type.