A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1766.html below:

CWG Issue 1766

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-08-11

1766. Values outside the range of the values of an enumerationSection: 9.8.1  [dcl.enum]     Status: CD4     Submitter: CWG     Date: 2013-09-23

[Moved to DR at the November, 2014 meeting.]

Although issue 1094 clarified that the value of an expression of enumeration type might not be within the range of the values of the enumeration after a conversion to the enumeration type (see 7.6.1.9 [expr.static.cast] paragraph 10), the result is simply an unspecified value. This should probably be strengthened to produce undefined behavior, in light of the fact that undefined behavior makes an expression non-constant. See also 11.4.10 [class.bit] paragraph 4.

Proposed resolution (February, 2014):

Change 7.6.1.9 [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.8.1 [dcl.enum]). Otherwise, the resulting value is unspecified (and might not be in that range) behavior is undefined. A value of floating-point type...

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4