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

2024-04-18


2251. Unreachable enumeration list-initialization

Section: 9.4.5  [dcl.init.list]     Status: C++17     Submitter: Richard Smith     Date: 2016-03-22

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

P0138R2 adds a new bullet for enum initialization after bullet 8 of 9.4.5 [dcl.init.list] paragraph 3. However, paragraph 7 already dealt with all the cases where the initializer list contains a single element and the target type is a non-reference type, so the new paragraph 9 rule is unreachable.

Proposed resolution (December, 2016):

Reorder the bullets in 9.4.5 [dcl.init.list] paragraph 3 as follows:

List-initialization of an object or reference of type T is defined as follows: