Use different name for auto variable
authorSerge Pavlov <sepavloff@gmail.com>
Thu, 24 Sep 2020 10:27:27 +0000 (17:27 +0700)
committerSerge Pavlov <sepavloff@gmail.com>
Thu, 24 Sep 2020 10:32:24 +0000 (17:32 +0700)
Without this change GCC 5.4.0 failed to compile JSON.cpp with the error:

    .../llvm-project/llvm/lib/Support/JSON.cpp: In lambda function:
    .../llvm-project/llvm/lib/Support/JSON.cpp:291:29: error: use of 'V' before deduction of 'auto'
           for (const auto &V : *V.getAsArray())

llvm/lib/Support/JSON.cpp

index 0672ddd..d44961b 100644 (file)
@@ -288,8 +288,8 @@ void abbreviateChildren(const Value &V, OStream &JOS, raw_ostream &OS) {
   switch (V.kind()) {
   case Value::Array:
     JOS.array([&] {
-      for (const auto &V : *V.getAsArray())
-        abbreviate(V, JOS, OS);
+      for (const auto &I : *V.getAsArray())
+        abbreviate(I, JOS, OS);
     });
     break;
   case Value::Object: