[LLVMbugs] [Bug 9983] New: clang crashes when using std::bind with a non-static method

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 22 01:02:11 PDT 2011


           Summary: clang crashes when using std::bind with a non-static
           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

Created an attachment (id=6627)
 --> (http://llvm.org/bugs/attachment.cgi?id=6627)
Preprocessed source

The following code (preprocessed version attached) crashes clang trunk with
libc++ trunk:

#include <functional>

struct Container {
    void lookup() const {}

void lookup(Container&) {}

template <typename Functor>
static void foo(Functor f)

int main(int, char**)
    Container    c;
    foo(std::bind(&Container::lookup, c));    // A
    //foo(std::bind(&lookup, c));            // B

$ ~/LLVM/build/Debug+Asserts/bin/clang -std=c++0x -stdlib=libc++ clang.cpp
Assertion failed: (false && "Not an overloaded operator"), function
mangleOperatorName, file
/Users/rynnsauer/LLVM/llvm/tools/clang/lib/AST/ItaniumMangle.cpp, line 1435.

(Full crash log attached)

Commenting line (A) and uncommenting line (B) results in a successful compile.

My clang version:

$ ~/LLVM/build/Debug+Asserts/bin/clang --versionclang version 3.0 (trunk
Target: x86_64-apple-darwin10.7.0
Thread model: posix

My libc++ version:

$ svn info .
Revision: 131842

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