[clang-tidy] Fix unnamed parameter comment insertion with multiple parameters.
llvm-svn: 214703
diff --git a/clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp b/clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp
index c10b2a3..ab901bc 100644
--- a/clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/NamedParameterCheck.cpp
@@ -77,10 +77,10 @@
auto D = diag(FirstParm->getLocation(),
"all parameters should be named in a function");
- // Fallback to an unused marker.
- StringRef NewName = "unused";
-
for (auto P : UnnamedParams) {
+ // Fallback to an unused marker.
+ StringRef NewName = "unused";
+
// If the method is overridden, try to copy the name from the base method
// into the overrider.
const auto *M = dyn_cast<CXXMethodDecl>(P.first);