Title
Enum whose enumerators will not fit in any integral type
Status
cd1
Section
9.7.1 [dcl.enum]
Submitter
Mark Mitchell

Created on 2002-08-30.00:00:00 last changed 34 months ago

Messages

Date: 2003-04-15.00:00:00

[Voted into WP at April 2003 meeting.]

Date: 2022-02-18.07:47:23

Proposed resolution:

In 9.7.1 [dcl.enum] paragraph 5 after

The underlying type of an enumeration is an integral type that can represent all the enumerator values defined in the enumeration.
insert
If no integral type can represent all the enumerator values, the enumeration is ill-formed.

Date: 2022-02-18.07:47:23

9.7.1 [dcl.enum] defines the underlying type of an enumeration as an integral type "that can represent all the enumerator values defined in the enumeration".

What does the standard say about this code:

  enum E { a = LONG_MIN, b = ULONG_MAX };

?

I think this should be ill-formed.

History
Date User Action Args
2022-02-18 07:47:23adminsetmessages: + msg6685
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2003-04-25 00:00:00adminsetmessages: + msg862
2003-04-25 00:00:00adminsetstatus: ready -> wp
2002-11-08 00:00:00adminsetstatus: open -> ready
2002-08-30 00:00:00admincreate