Added option to ignore virtual methods in this check.
This allows to quickly get rid of big number of
potentialy false-positive issues without inserting
not-needed comments.
Fixes #55665.
Paths
| Differential D147918
[clang-tidy] Added IgnoreVirtual option to misc-unused-parameters ClosedPublic Authored by PiotrZSL on Apr 10 2023, 1:03 AM.
Details Summary Added option to ignore virtual methods in this check. Fixes #55665.
Diff Detail
Event TimelineComment Actions Looks good, small comments!
Comment Actions Have you thought about handling CRTP overrides template <typename T> class Base { int getThing(int x) { return x; } }; class Derived : public Base<Derived> { int getThing(int x) { return 0; } }; I'm not saying update this to work for that, but could be a good direction in the future.
This revision is now accepted and ready to land.Apr 10 2023, 6:10 AM This revision was landed with ongoing or failed builds.Apr 10 2023, 7:56 AM Closed by commit rG225d255a583e: [clang-tidy] Added IgnoreVirtual option to misc-unused-parameters (authored by PiotrZSL). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 512122 clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h
clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/misc/unused-parameters.rst
clang-tools-extra/test/clang-tidy/checkers/misc/unused-parameters-virtual.cpp
|
Since these 2 conditions are unrelated, I believe it's better to put them in separate ifs: