You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A nested-name-specifier that denotes an enumeration (7.2), followed by the name of an enumerator of that
enumeration, is a qualified-id that refers to the enumerator. The result is the enumerator. The type of the result is the type of the enumeration. The result is a prvalue.
Contradicts
7.2/5
If the underlying type is fixed, the type of each enumerator prior to the closing brace is the underlying type.
"A qualified-id that refers to the enumerator" cannot be both "the enumerator" and have "the type of the enumeration". In particular before the closing brace.
Or it would mean:
enum class E : short {
A,
B = A, // Works because A and B types are "short"
C = E::A // Does not work because C type is "short" but E::A type is "E" (but E::A is A and A type is short ???)
};
Isn't "The result is the enumerator." statement in 5.1.4.2/4 enough to fix the type without ambiguity and without requiring "The type of the result is the type of the enumeration." ?
The text was updated successfully, but these errors were encountered:
This repository and its issue tracker are for editorial issues. If you have concerns about the normative content of the Standard, you will find instructions on how to report those in the readme and the links therein.
From "Type of an enumerator in the declaration of its enum" question on stack overflow, it seems that
5.1.4.2/4
Contradicts
7.2/5
"A qualified-id that refers to the enumerator" cannot be both "the enumerator" and have "the type of the enumeration". In particular before the closing brace.
Or it would mean:
Isn't "The result is the enumerator." statement in 5.1.4.2/4 enough to fix the type without ambiguity and without requiring "The type of the result is the type of the enumeration." ?
The text was updated successfully, but these errors were encountered: