From f899bf135fc5b7bb030b90da686d9d89bb97d18f Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 26 Aug 2019 12:42:32 +0000 Subject: [PATCH] Fix windows build after r369894 Constructing a std::vector from a llvm::map_range fails on windows, apparently because std::vector expects the input iterator to have a const operator* (map_range iterator has a non-const one). This avoids the cleverness and unrolls the map-loop manually (which is also slightly shorter). llvm-svn: 369905 --- lldb/unittests/Symbol/PostfixExpressionTest.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lldb/unittests/Symbol/PostfixExpressionTest.cpp b/lldb/unittests/Symbol/PostfixExpressionTest.cpp index e9f78197fac7..b7fa73cacf4a 100644 --- a/lldb/unittests/Symbol/PostfixExpressionTest.cpp +++ b/lldb/unittests/Symbol/PostfixExpressionTest.cpp @@ -108,12 +108,10 @@ ParseFPOAndStringify(llvm::StringRef prog) { llvm::BumpPtrAllocator alloc; std::vector> parsed = ParseFPOProgram(prog, alloc); - auto range = llvm::map_range( - parsed, [](const std::pair &pair) { - return std::make_pair(pair.first, ASTPrinter::Print(pair.second)); - }); - return std::vector>(range.begin(), - range.end()); + std::vector> result; + for (const auto &p : parsed) + result.emplace_back(p.first, ASTPrinter::Print(p.second)); + return result; } TEST(PostfixExpression, ParseFPOProgram) {