Use reference type in for loop
authorCarlos Galvez <carlosgalvezp@gmail.com>
Tue, 19 Oct 2021 16:37:37 +0000 (16:37 +0000)
committerCarlos Galvez <carlosgalvezp@gmail.com>
Tue, 19 Oct 2021 16:37:56 +0000 (16:37 +0000)
To fix failing build job.

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

index 35abda4..2d3eb37 100644 (file)
@@ -451,7 +451,7 @@ lineIsWithinNolintBegin(const ClangTidyContext &Context,
   // The following blocks were never closed. Return diagnostics for each
   // instance that can be displayed along with the original clang-tidy check
   // that the user was attempting to suppress.
-  for (const auto NolintBegin : NolintBegins) {
+  for (const auto &NolintBegin : NolintBegins) {
     SuppressionErrors.emplace_back(
         createNolintError(Context, SM, NolintBegin.first, true));
   }