[llvm] 590cc06 - Use different name for auto variable

Serge Pavlov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 03:33:04 PDT 2020


Author: Serge Pavlov
Date: 2020-09-24T17:32:24+07:00
New Revision: 590cc068c160f3b623d47fb34fd1d26848cb0e0a

URL: https://github.com/llvm/llvm-project/commit/590cc068c160f3b623d47fb34fd1d26848cb0e0a
DIFF: https://github.com/llvm/llvm-project/commit/590cc068c160f3b623d47fb34fd1d26848cb0e0a.diff

LOG: Use different name for auto variable

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())

Added: 
    

Modified: 
    llvm/lib/Support/JSON.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/JSON.cpp b/llvm/lib/Support/JSON.cpp
index 0672dddd4ac0..d44961b43b89 100644
--- a/llvm/lib/Support/JSON.cpp
+++ b/llvm/lib/Support/JSON.cpp
@@ -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:


        


More information about the llvm-commits mailing list