Movatterモバイル変換


[0]ホーム

URL:


Issue 1766 - WG21 CWG Issues
Title
Values outside the range of the values of an enumeration
Status
cd4
Section
9.8.1 [dcl.enum]
Submitter
CWG

Created on2013-09-23.00:00:00 last changed109 months ago

Messages

msg5366 (view)
Date: 2014-11-15.00:00:00

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

msg4824 (view)
Date: 2014-02-15.00:00:00

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 anenumeration type. The value is unchanged if the original value is withinthe range of the enumeration values (9.8.1 [dcl.enum]). Otherwise,theresulting value is unspecified (and might not be in thatrange)behavior is undefined. A value of floating-pointtype...
msg4648 (view)
Date: 2013-09-23.00:00:00

Althoughissue 1094 clarified that the valueof an expression of enumeration type might not be within the range of thevalues of the enumeration after a conversion to the enumeration type (see7.6.1.9 [expr.static.cast] paragraph 10), the result is simply anunspecified value. This should probably be strengthened to produceundefined behavior, in light of the fact that undefined behavior makes anexpression non-constant. See also 11.4.10 [class.bit] paragraph 4.

History
DateUserActionArgs
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: +msg5366
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetmessages: +msg4824
2014-03-03 00:00:00adminsetstatus: open -> ready
2013-09-23 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp