This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-12-19
[Voted into the WP at the March, 2011 meeting as part of paper N3262.]
The current wording of the WP appears not to allow for list-initialization of a reference like the following:
int i; int& ir{i};
First, 9.4 [dcl.init] bullet 16.1 reads,
If the initializer is a braced-init-list, the object is list-initialized (8.5.4).
A reference is not an object, so this does not appear to apply; however, the second bullet sends reference initialization off to 9.4.4 [dcl.init.ref], which does not cover braced-init-lists: paragraph 5 of that section deals only with initilizer expressions, and a braced-init-list is not an expression.
Assuming that the use of “object” in the first bullet is just an oversight, 9.4.5 [dcl.init.list] also does not cover the case of a reference to a scalar type whose initalizer is a braced-init-list with a single element. Bullet 7 of paragraph 3 reads,
Otherwise, if the initializer list has a single element, the object is initialized from that element
and would cover this case except that, again, a reference is not an object. As a result, such an initialization would end up in the last bullet and consequently be ill-formed.
Presumably all that is needed is to add “or reference” to the appropriate bullets of 9.4 [dcl.init] paragraph 16 and 9.4.5 [dcl.init.list] paragraph 3.
Proposed resolution (November, 2010) [SUPERSEDED]:
Change 9.4 [dcl.init] bullet 16.1 as follows:
If the initializer is a braced-init-list, the object or reference is list-initialized (9.4.5 [dcl.init.list]).
Change 9.4.5 [dcl.init.list] bullet 3.7 as follows:
Otherwise, if the initializer list has a single element, the object or reference is initialized from that element; if a narrowing conversion (see below) is required to convert the element to T, the program is ill-formed.