diff options
author | Pavel Labath <pavel@labath.sk> | 2019-10-18 11:47:23 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-10-18 11:47:23 +0000 |
commit | 0c304917740228968d2daf1a414e7ec3f94cd171 (patch) | |
tree | 09886063c63c656f8c90a8010ed75a71302609f6 | |
parent | 9c155985f17fd369bbba311b714fb6c01c17d66e (diff) | |
download | bcm5719-llvm-0c304917740228968d2daf1a414e7ec3f94cd171.tar.gz bcm5719-llvm-0c304917740228968d2daf1a414e7ec3f94cd171.zip |
SystemInitializerCommon fix compilation on linux
C++ defines two overloads of std::iscntrl. One in <cctype> and one in
<locale>. 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
-rw-r--r-- | lldb/source/Initialization/SystemInitializerCommon.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Initialization/SystemInitializerCommon.cpp b/lldb/source/Initialization/SystemInitializerCommon.cpp index e928bbc1641..36cec3094f3 100644 --- a/lldb/source/Initialization/SystemInitializerCommon.cpp +++ b/lldb/source/Initialization/SystemInitializerCommon.cpp @@ -80,7 +80,8 @@ llvm::Error SystemInitializerCommon::Initialize() { } if (llvm::Expected<std::string> cwd = loader->LoadBuffer<WorkingDirectoryProvider>()) { - 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() |