Created on2016-03-22.00:00:00 last changed96 months ago
Proposed resolution (December, 2016):
Reorder the bullets in 9.5.5 [dcl.init.list] paragraph 3 asfollows:
List-initialization of an object or reference of typeT isdefined as follows:
...
Otherwise, ifT is a class type, constructors areconsidered...
Otherwise, ifT is an enumeration with a fixed underlyingtype (9.8.1 [dcl.enum]), theinitializer-list has a singleelementv, and the initialization is direct-list-initialization,the object is initialized with the valueT(v)(7.6.1.4 [expr.type.conv]); if a narrowing conversion is required toconvert v to the underlying type ofT, the program is ill-formed.[Example:...
Otherwise, if the initializer list has a single element oftypeE...
Otherwise, ifT is a reference type...
Otherwise, ifT is an enumeration with a fixedunderlying type...
[Adopted at the February/March, 2017 meeting.]
P0138R2 adds a new bullet for enum initialization after bullet 8 of9.5.5 [dcl.init.list] paragraph 3. However, paragraph 7 alreadydealt with all the cases where the initializer list contains a singleelement and the target type is a non-reference type, so the newparagraph 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 | |