Section: 184.108.40.206 [optional.ctor], 220.127.116.11 [optional.assign], 18.104.22.168 [variant.ctor], 22.214.171.124 [any.cons], 126.96.36.199 [any.modifiers] Status: New Submitter: Tim Song Opened: 2016-10-29 Last modified: 2017-02-02
View all other issues in [optional.ctor].
View all issues with New status.
Throughout optional/variant/any's specification references are made to "the selected constructor of T". For example, 188.8.131.52 [optional.ctor]/16 says of the constructor from const T&:
-16- Remarks: If T's selected constructor is a constexpr constructor, this constructor shall be a constexpr constructor.
Similarly, the in-place constructor has this wording (184.108.40.206 [optional.ctor]/25-26):
-25- Throws: Any exception thrown by the selected constructor of T.-26- Remarks: If T's constructor selected for the initialization is a constexpr constructor, this constructor shall be a constexpr constructor.
If T is a scalar type, it has no constructor at all. Moreover, even for class types, the in-place constructor wording ignores any implicit conversion done on the argument before the selected constructor is called, which 1) may not be valid in constant expressions and 2) may throw an exception; such exceptions aren't thrown "by the selected constructor of T" but outside it.The wording should probably be recast to refer to the entire initialization.
[Issues Telecon 16-Dec-2016]
Priority 3; Jonathan to provide wording.