[clang-tidy] support unscoped enumerations in readability-static-accessed-through...
authorCongcong Cai <congcongcai0907@163.com>
Mon, 3 Apr 2023 10:41:29 +0000 (12:41 +0200)
committerCongcong Cai <congcongcai0907@163.com>
Mon, 3 Apr 2023 10:58:35 +0000 (12:58 +0200)
commitedd6a33984eeb57bd4e8d3459878cc7a66825389
treec65a16ab112ac01470ca54fa01bd3b813661a3cc
parent4301178299e406b7ca0795b1f5ef1c4359aace47
[clang-tidy] support unscoped enumerations in readability-static-accessed-through-instance

fixed [60810](https://github.com/llvm/llvm-project/issues/60810)
unscoped enumerations in class can also be checked by `readability-static-accessed-through-instance`
add matcher for `enumConstantDecl` to match format
```
struct {
    enum { E1 };
};
```
The filter of member expression and the fix hint should be same as other condition.

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D147315
clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/readability/static-accessed-through-instance.rst
clang-tools-extra/test/clang-tidy/checkers/readability/static-accessed-through-instance.cpp