Created on 2010-07-17.00:00:00 last changed 96 months ago
[Voted into the WP at the March, 2011 meeting.]
Proposed resolution (November, 2010):
Change 188.8.131.52 [expr.static.cast] paragraph 10 as follows:
A value of integral or enumeration type can be explicitly converted to an enumeration type. The value is unchanged if the original value is within the range of the enumeration values (9.7.1 [dcl.enum]). Otherwise, the resulting
enumerationvalue is unspecified .
Add the following footnote to the end of 9.7.1 [dcl.enum] paragraph 7:
...If the enumerator-list is empty, the values of the enumeration are as if the enumeration had a single enumerator with value 0.
Delete 9.7.1 [dcl.enum] paragraph 10:
An expression of arithmetic or enumeration type can be converted to an enumeration type explicitly. The value is unchanged if it is in the range of enumeration values of the enumeration type; otherwise the resulting enumeration value is unspecified.
According to 9.7.1 [dcl.enum] paragraph 10,
An expression of arithmetic or enumeration type can be converted to an enumeration type explicitly.
However, 184.108.40.206 [expr.static.cast] paragraph 10 says only,
A value of integral or enumeration type can be explicitly converted to an enumeration type.
This omits floating-point values. Presumably unscoped enumeration types are covered by paragraph 7,
The inverse of any standard conversion sequence (Clause 7.3 [conv]), other than the lvalue-to-rvalue (7.3.2 [conv.lval]), array-to- pointer (7.3.3 [conv.array]), function-to-pointer (7.3.4 [conv.func]), and boolean (7.3.14 [conv.fctptr]) conversions, can be performed explicitly using static_cast.
because 7.3.11 [conv.fpint] paragraph 2 allows an unscoped enumeration value to be implicitly converted to a floating point type. (Although that also covers the integral types, so it's not clear why they would be mentioned specifically in 220.127.116.11 [expr.static.cast] paragraph 10.) However, this should presumably say “arithmetic” instead of “integral” to match the statement in 9.7.1 [dcl.enum] paragraph 10.
|2014-03-03 00:00:00||admin||set||status: fdis -> c++11|
|2011-04-10 00:00:00||admin||set||messages: + msg3311|
|2011-04-10 00:00:00||admin||set||status: ready -> fdis|
|2010-11-29 00:00:00||admin||set||messages: + msg3051|
|2010-11-29 00:00:00||admin||set||status: open -> ready|