Underlying type should determine size and alignment requirements of an enum
9.7.1 [dcl.enum]
Brian Bi

Created on 2022-05-15.00:00:00 last changed 3 weeks ago


Date: 2022-06-15.07:14:25

Suggested resolution:

Add a new paragraph after 9.7.1 [dcl.enum] paragraph 8:

For an enumeration whose underlying type is fixed, ...

An enumeration has the same size, value representation, and alignment requirements (6.7.6 [basic.align]) as its underlying type. Furthermore, each value of an enumeration has the same representation as the same value of the underlying type.

Two enumeration types are layout-compatible enumerations if ...

Date: 2022-05-15.00:00:00

Subclause 9.7.1 [dcl.enum] specifies how the underlying type of an enumeration is determined, and, for scoped enumerations, specifies that the enumeration has the same set of values as the underlying type. However, the specification does not relate the size and alignment requirements of the enumeration to those of the underlying type. Those ought to be the same.

Date User Action Args
2022-05-30 18:14:38adminsetmessages: + msg6837
2022-05-15 00:00:00admincreate