From 0c304917740228968d2daf1a414e7ec3f94cd171 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 18 Oct 2019 11:47:23 +0000 Subject: [PATCH] SystemInitializerCommon fix compilation on linux C++ defines two overloads of std::iscntrl. One in and one in . On linux we seem to include both which makes the std::erase_if call ambiguous. Wrap std::iscntrl call in a lambda to ensure regular overload resolution. llvm-svn: 375221 --- lldb/source/Initialization/SystemInitializerCommon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lldb/source/Initialization/SystemInitializerCommon.cpp b/lldb/source/Initialization/SystemInitializerCommon.cpp index e928bbc..36cec30 100644 --- a/lldb/source/Initialization/SystemInitializerCommon.cpp +++ b/lldb/source/Initialization/SystemInitializerCommon.cpp @@ -80,7 +80,8 @@ llvm::Error SystemInitializerCommon::Initialize() { } if (llvm::Expected cwd = loader->LoadBuffer()) { - cwd->erase(std::remove_if(cwd->begin(), cwd->end(), std::iscntrl), + cwd->erase(std::remove_if(cwd->begin(), cwd->end(), + [](char c) { return std::iscntrl(c); }), cwd->end()); if (std::error_code ec = FileSystem::Instance() .GetVirtualFileSystem() -- 2.7.4