diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -744,7 +744,7 @@ ArrayRef Dirs, StringRef FileName) { SmallString<128> WPath; - for (const StringRef &Dir : Dirs) { + for (const std::string &Dir : Dirs) { if (Dir.empty()) continue; WPath.clear(); diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -850,7 +850,7 @@ /*static*/ void ToolChain::addSystemIncludes(const ArgList &DriverArgs, ArgStringList &CC1Args, ArrayRef Paths) { - for (const auto Path : Paths) { + for (const auto &Path : Paths) { CC1Args.push_back("-internal-isystem"); CC1Args.push_back(DriverArgs.MakeArgString(Path)); }