[Driver] Don't implicitly copy std::strings in for-range loop.
Found by -Wrange-loop-analysis.
llvm-svn: 248495
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 3dd9979..04ea874 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -1497,7 +1497,7 @@
CudaPathCandidates.push_back(D.SysRoot + "/usr/local/cuda-7.0");
}
- for (const auto CudaPath : CudaPathCandidates) {
+ for (const auto &CudaPath : CudaPathCandidates) {
if (CudaPath.empty() || !llvm::sys::fs::exists(CudaPath))
continue;