Skip to content

-Wenum-enum-conversion missing for compound assignments #162941

@ahatanak

Description

@ahatanak
enum E1 { A };
enum E2 { B };

void test(enum E1 e1, enum E2 e2) {
  e1 = e1 | e2; // warning: bitwise operation between different enumeration types
  e1 |= e2; // no warning 
}

clang should emit warning -Wenum-enum-conversion for the compound assignment too since it also performs a bitwise operation between E1 and E2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions