Created on 2016-03-22.00:00:00 last changed 81 months ago
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:
...
Otherwise, if T is a class type, constructors are considered...
Otherwise, if T is an enumeration with a fixed underlying type (9.7.1 [dcl.enum]), the initializer-list has a single element v, and the initialization is direct-list-initialization, the object is initialized with the value T(v) (7.6.1.4 [expr.type.conv]); if a narrowing conversion is required to convert v to the underlying type of T, the program is ill-formed. [Example:...
Otherwise, if the initializer list has a single element of type E...
Otherwise, if T is a reference type...
Otherwise, if T is an enumeration with a fixed underlying type...
[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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-02-27 00:00:00 | admin | set | status: review -> c++17 |
2017-02-06 00:00:00 | admin | set | messages: + msg5748 |
2016-03-22 00:00:00 | admin | create |