[PATCH] D147918: [clang-tidy] Added IgnoreVirtual option to misc-unused-parameters
Carlos Galvez via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 10 04:29:23 PDT 2023
carlosgalvezp added a comment.
Looks good, small comments!
================
Comment at: clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp:183
+ if (Method->isLambdaStaticInvoker() ||
+ (IgnoreVirtual && Method->isVirtual()))
return;
----------------
Since these 2 conditions are unrelated, I believe it's better to put them in separate ifs:
```
if (IgnoreVirtual && Method->isVirtual())
return;
if (Method->isLambdaStaticInvoker())
return;
```
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/misc/unused-parameters-virtual.cpp:4
+
+struct Class {
+ int f(int foo) {
----------------
We typically call it `Base`. `Class` can also be confusing since it's a `struct` ;)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147918/new/
https://reviews.llvm.org/D147918
More information about the cfe-commits
mailing list