This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Do not take address of std::iscntrl in std::remove_if
AbandonedPublic

Authored by KyrBoh on Oct 18 2019, 6:15 AM.

Details

Summary

Due to the fact, that getting an address of function in the standard library causes undefined behaviour, LLDB fails to compile in my environment with en error saying "unable to find function to call for remove_if(..., <unresolved function type>)".

Just use the fix suggested by cppreference: wrap function into a lambda: https://en.cppreference.com/w/cpp/string/byte/iscntrl

Environment used:
OS: Ubuntu Eoan (19.10), x86_64
Compiler: g++ (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

cmake \
  -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libunwind;lldb;compiler-rt;lld;polly" \
  -DLLVM_TARGETS_TO_BUILD="X86" \
  -DLLVM_BUILD_LLVM_DYLIB=ON \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=/opt/llvm-git \
  ../llvm-project/llvm

Diff Detail

Event Timeline

KyrBoh created this revision.Oct 18 2019, 6:15 AM
Herald added a project: Restricted Project. · View Herald Transcript
KyrBoh updated this revision to Diff 225607.Oct 18 2019, 6:17 AM

Correct patch.

KyrBoh edited the summary of this revision. (Show Details)Oct 18 2019, 6:17 AM
KyrBoh edited the summary of this revision. (Show Details)
labath added a subscriber: labath.Oct 18 2019, 6:25 AM

I already submitted the very same patch in r375221.

KyrBoh abandoned this revision.Oct 18 2019, 6:29 AM

Per labath's comment