forked from OSchip/llvm-project
Fix issues reported by -Wrange-loop-analysis when building with latest Clang (trunk). NFC.
Fixes warning: loop variable 'E' of type 'const llvm::StringRef' creates a copy from type 'const llvm::StringRef' [-Wrange-loop-analysis]
This commit is contained in:
parent
c972f6fd79
commit
75eacbf1a9
|
@ -56,7 +56,7 @@ MATCHER_P(WithTemplateArgs, ArgName, "") {
|
|||
LangOptions LO;
|
||||
PrintingPolicy Policy(LO);
|
||||
Policy.adjustForCPlusPlus();
|
||||
for (const auto Arg : Args->asArray()) {
|
||||
for (const auto &Arg : Args->asArray()) {
|
||||
if (SpecializationArgs.size() > 0)
|
||||
SpecializationArgs += ",";
|
||||
SpecializationArgs += Arg.getAsType().getAsString(Policy);
|
||||
|
|
|
@ -404,7 +404,7 @@ TEST(RenameTest, WithinFileRename) {
|
|||
template <> struct Bar<[[Foo]]> {};
|
||||
)cpp",
|
||||
};
|
||||
for (const auto T : Tests) {
|
||||
for (llvm::StringRef T : Tests) {
|
||||
Annotations Code(T);
|
||||
auto TU = TestTU::withCode(Code.code());
|
||||
TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
|
||||
|
|
|
@ -197,7 +197,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program,
|
|||
// An environment block consists of a null-terminated block of
|
||||
// null-terminated strings. Convert the array of environment variables to
|
||||
// an environment block by concatenating them.
|
||||
for (const auto E : *Env) {
|
||||
for (StringRef E : *Env) {
|
||||
SmallVector<wchar_t, MAX_PATH> EnvString;
|
||||
if (std::error_code ec = windows::UTF8ToUTF16(E, EnvString)) {
|
||||
SetLastError(ec.value());
|
||||
|
|
Loading…
Reference in New Issue