[Lldb-commits] [lldb] 7f717b6 - [lldb] Fix "no matching std::pair constructor" on Ubuntu 16.04 (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 27 17:23:52 PDT 2020


Author: Jonas Devlieghere
Date: 2020-08-27T17:23:44-07:00
New Revision: 7f717b6d1f65f8474e8633b040a16c55f0ad6b96

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

LOG: [lldb] Fix "no matching std::pair constructor" on Ubuntu 16.04 (NFC)

Fixes error: no matching constructor for initialization of
'std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >'
with older toolchain (clang/libcxx) on Ubuntu 16.04. The issue is the
StringRef-to-std::string conversion.

Added: 
    

Modified: 
    lldb/unittests/Symbol/PostfixExpressionTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/Symbol/PostfixExpressionTest.cpp b/lldb/unittests/Symbol/PostfixExpressionTest.cpp
index 7def709a6090..aee153d5ccef 100644
--- a/lldb/unittests/Symbol/PostfixExpressionTest.cpp
+++ b/lldb/unittests/Symbol/PostfixExpressionTest.cpp
@@ -111,7 +111,7 @@ ParseFPOAndStringify(llvm::StringRef prog) {
       ParseFPOProgram(prog, alloc);
   std::vector<std::pair<std::string, std::string>> result;
   for (const auto &p : parsed)
-    result.emplace_back(p.first, ASTPrinter::Print(p.second));
+    result.emplace_back(p.first.str(), ASTPrinter::Print(p.second));
   return result;
 }
 


        


More information about the lldb-commits mailing list