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 (10.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.
is in conflict with [dcl.enum]/5
Each enumeration defines a type that is different from all other types. Each enumeration also has an underlying type. The underlying type can be explicitly specified using an enum-base. For a scoped enumeration type, the underlying type is int if it is not explicitly specified. In both of these cases, the underlying type is said to be fixed. Following the closing brace of an enum-specifier, each enumerator has the type of its enumeration. If the underlying type is fixed, the type of each enumerator prior to the closing brace is the underlying type and the constant-expression in the enumerator-definition shall be a converted constant expression of the underlying type (8.20). [...]
in this example:
enum class E {
A,
B = E::A // what is the type of E::A?
};
The clang and gcc seem to follow [dcl.enum]/5. The two parts would not be in conflict if the [expr.prim.id.qual]/4 said:
[...] The type of the result is the type of the enumerator. [...]
I believe that [expr.prim.id.qual]/4
is in conflict with [dcl.enum]/5
in this example:
The clang and gcc seem to follow [dcl.enum]/5. The two parts would not be in conflict if the [expr.prim.id.qual]/4 said:
It was discussed on StackOverflow a few months ago.
The text was updated successfully, but these errors were encountered: