[libcxx-commits] [libcxxabi] 1c1bb77 - [libc++abi] Fix issue when building the demangler in C++11

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 25 09:42:10 PDT 2024


Author: Louis Dionne
Date: 2024-09-25T12:41:09-04:00
New Revision: 1c1bb7749860b4265c002528cbfe4b6c623b934c

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

LOG: [libc++abi] Fix issue when building the demangler in C++11

Captures with an initializer only work in C++14. This broke the C++11
CI but wasn't noticed because our CI was down.

Added: 
    

Modified: 
    libcxxabi/src/demangle/ItaniumDemangle.h
    llvm/include/llvm/Demangle/ItaniumDemangle.h

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index 723bdfe324b140..501d0b6fdfcd16 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -2632,7 +2632,8 @@ template<typename NodeT> struct NodeKind;
 #include "ItaniumNodes.def"
 
 inline bool NodeArray::printAsString(OutputBuffer &OB) const {
-  auto Fail = [&OB, StartPos = OB.getCurrentPosition()] {
+  auto StartPos = OB.getCurrentPosition();
+  auto Fail = [&OB, StartPos] {
     OB.setCurrentPosition(StartPos);
     return false;
   };

diff  --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index 9ada4d747b1ce9..56ff3cfb148f09 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -2632,7 +2632,8 @@ template<typename NodeT> struct NodeKind;
 #include "ItaniumNodes.def"
 
 inline bool NodeArray::printAsString(OutputBuffer &OB) const {
-  auto Fail = [&OB, StartPos = OB.getCurrentPosition()] {
+  auto StartPos = OB.getCurrentPosition();
+  auto Fail = [&OB, StartPos] {
     OB.setCurrentPosition(StartPos);
     return false;
   };


        


More information about the libcxx-commits mailing list