[clang-tools-extra] [clang-tidy] Improve performance-enum-size to exclude empty enums (PR #71640)
Congcong Cai via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 8 01:31:06 PST 2023
================
@@ -23,6 +23,10 @@ namespace clang::tidy::performance {
namespace {
+AST_MATCHER(EnumDecl, hasEnumerators) {
+ return Node.enumerator_begin() != Node.enumerator_end();
----------------
HerrCai0907 wrote:
```suggestion
return !Node.enumerators().empty();
```
https://github.com/llvm/llvm-project/pull/71640
More information about the cfe-commits
mailing list