Index: clang/lib/AST/ComputeDependence.cpp =================================================================== --- clang/lib/AST/ComputeDependence.cpp +++ clang/lib/AST/ComputeDependence.cpp @@ -750,7 +750,7 @@ // If we have explicit template arguments, check for dependent // template arguments and whether they contain any unexpanded pack // expansions. - for (auto A : E->template_arguments()) + for (const auto &A : E->template_arguments()) Deps |= toExprDependence(A.getArgument().getDependence()); return Deps; } Index: clang/lib/Frontend/FrontendActions.cpp =================================================================== --- clang/lib/Frontend/FrontendActions.cpp +++ clang/lib/Frontend/FrontendActions.cpp @@ -882,7 +882,7 @@ } // Now let's print out any modules we did not see as part of the Primary. - for (auto SM : SubModMap) { + for (const auto &SM : SubModMap) { if (!SM.second.Seen && SM.second.Mod) { Out << " " << ModuleKindName(SM.second.Kind) << " '" << SM.first << "' at index #" << SM.second.Idx