[llvm] f5cd172 - [Support] Work around an issue when building with old versions of libstdc++

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 26 04:03:05 PDT 2022


Author: Benjamin Kramer
Date: 2022-06-26T12:55:51+02:00
New Revision: f5cd172e515f5bbc15ed95ca57def4ab7c3bbb0c

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

LOG: [Support] Work around an issue when building with old versions of libstdc++

llvm/lib/Support/UnicodeNameToCodepoint.cpp:189:12: error: chosen constructor is explicit in copy-initialization
    return {N, false, 0};
           ^~~~~~~~~~~~~
/usr/include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
        constexpr tuple(_UElements&&... __elements)
                  ^

Added: 
    

Modified: 
    llvm/lib/Support/UnicodeNameToCodepoint.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/UnicodeNameToCodepoint.cpp b/llvm/lib/Support/UnicodeNameToCodepoint.cpp
index 71ee4ce9f2dd..1e8aebf1b8eb 100644
--- a/llvm/lib/Support/UnicodeNameToCodepoint.cpp
+++ b/llvm/lib/Support/UnicodeNameToCodepoint.cpp
@@ -186,10 +186,10 @@ compareNode(uint32_t Offset, StringRef Name, bool Strict,
       N.IsRoot || startsWith(Name, N.Name, Strict, Consummed,
                              PreviousCharInName, PreviousCharInNeedle);
   if (!DoesStartWith)
-    return {N, false, 0};
+    return std::make_tuple(N, false, 0);
 
   if (Name.size() - Consummed == 0 && N.Value != 0xFFFFFFFF)
-    return {N, true, N.Value};
+    return std::make_tuple(N, true, N.Value);
 
   if (N.hasChildren()) {
     uint32_t ChildOffset = N.ChildrenOffset;
@@ -203,14 +203,14 @@ compareNode(uint32_t Offset, StringRef Name, bool Strict,
       if (Matches) {
         std::reverse_copy(C.Name.begin(), C.Name.end(),
                           std::back_inserter(Buffer));
-        return {N, true, Value};
+        return std::make_tuple(N, true, Value);
       }
       ChildOffset += C.Size;
       if (!C.HasSibling)
         break;
     }
   }
-  return {N, false, 0};
+  return std::make_tuple(N, false, 0);
 }
 
 static std::tuple<Node, bool, uint32_t>


        


More information about the llvm-commits mailing list