Skip to content

Integral promotion of enums should go all the way #7257

@t3nsor

Description

@t3nsor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions