llvm / llvm/llvm-project

`-Wenum-enum-conversion` missing for compound assignments

Open
#162,941 1 comment 0 reactions 0 assignees View on GitHub
clang:diagnostics
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```
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`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.