misc-unused-parameters: Properly handle static class members.
Not sure why I wrote what I wrote before.
llvm-svn: 243403
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
index 02cb621..18e3960 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
@@ -70,10 +70,11 @@
};
// Comment out parameter name for non-local functions.
- if ((Function->isExternallyVisible() &&
- Function->getStorageClass() != StorageClass::SC_Static) ||
- UsedByRef()) {
+ if (Function->isExternallyVisible() || UsedByRef()) {
SourceRange RemovalRange(Param->getLocation(), Param->getLocEnd());
+ // Note: We always add a space before the '/*' to not accidentally create a
+ // '*/*' for pointer types, which doesn't start a comment. clang-format will
+ // clean this up afterwards.
MyDiag << FixItHint::CreateReplacement(
RemovalRange, (Twine(" /*") + Param->getName() + "*/").str());
return;