Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integral promotion of enums should go all the way #7257

Open
t3nsor opened this issue Sep 16, 2024 · 0 comments
Open

Integral promotion of enums should go all the way #7257

t3nsor opened this issue Sep 16, 2024 · 0 comments

Comments

@t3nsor
Copy link
Contributor

t3nsor commented Sep 16, 2024

According to [conv.prom]/4, there are two possible forms of promotion that can be applied to an enumeration whose underlying type is fixed. For example, an enum with fixed underlying type of signed char can be promoted to either signed char or int (i.e. the result of promoting signed char).

However, the standard in various places refers to the idea of promoting an operand, as if it had an unambiguous meaning, e.g. in [expr.arith.conv]. The intended meaning, in the case of enums, is to promote them to a type that can't be promoted anymore (i.e., if the underlying type has lesser rank than int, then the promotion is to the promoted underlying type). This should be clarified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant