[clang-tidy][request] Check that detects unqualified enumerator usage
Open
check-request
clang-tidy
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```c++
enum E { E0, E1 };
E f(E e) {
if (e == E0) {} // warn
return E::E1; // ok
}
```
Use cases: C++ code using C headers, preparation of switch to `enum class`, improve readability.
Contributor guide
Research direction
Start by locating the clang-tidy check entry points and nearby check tests, then compare the supplied C++ example with existing diagnostics. The work is done when unqualified enumerator use such as E0 is diagnosed while qualified use such as E::E1 is accepted, with coverage for the stated C++ header and enum-class migration use cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100