Skip to content

[basic.def.odr] Validity of duplicate enumerators CWG2530 #4788

@xmh0511

Description

@xmh0511
enum class A{
    a = 0,
    a = 1
};

[basic#pre-5.12] specifies that an enumerator-definition is a declaration. According to [basic.link#8], they declare the same entity. For this example, the major implementations report that "redefinition of enumerator 'a'"., however, [basic.def.odr#1] didn't mention enumerators

No translation unit shall contain more than one definition of any variable, function, class type, enumeration type, template, default argument for a parameter (for a function in a given scope), or default template argument.

Does the rule omit such a case? Also, ask the clarification of this case in this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions