Created on 2010-01-22.00:00:00 last changed 130 months ago
[Voted into the WP at the March, 2011 meeting.]
Proposed resolution (November, 2010):
This issue is resolved by the resolution of issue 1094.
According to 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.
(There is similar wording in 7.6.1.9 [expr.static.cast].) Does the phrase “resulting enumeration value” mean that the result, although unspecified, must lie within the range of enumeration values of the enumeration type? Existing practice seems to allow out-of-range values to be preserved if the underlying type is large enough to represent the value. This freedom is important both for efficiency (to avoid having to mask values while storing and/or fetching) and to prevent optimizers from removing code that tests for out-of-range values.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | messages: + msg3334 |
2011-04-10 00:00:00 | admin | set | status: ready -> fdis |
2010-11-29 00:00:00 | admin | set | status: review -> ready |
2010-08-23 00:00:00 | admin | set | messages: + msg2828 |
2010-08-23 00:00:00 | admin | set | status: open -> review |
2010-01-22 00:00:00 | admin | create |