[LLVMbugs] [Bug 11117] New: Link error when using libc++'s std::bind

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 12 04:29:26 PDT 2011


           Summary: Link error when using libc++'s std::bind
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jonathan.sauer at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

The following program compiles, but fails to link with clang r141771 and libc++

#include <functional>

using namespace std::placeholders;

struct Foo {
    void doItB()

template <typename F>
static void bar(F f)
    Foo    foo;

int main(int, char**)
    bar(std::bind(&Foo::doItB, _1));

This results in:

$ ~/LLVM/build/Release+Asserts/bin/clang++ -std=c++0x -stdlib=libc++ -v
clang version 3.0 (trunk 141771)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
Undefined symbols:
referenced from:
in clang-whLOw0.o
ld: symbol(s) not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This error does not occur with clang r140992 (which is why I'm filing this as a
clang bug).

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list