[LLVMbugs] [Bug 18074] New: Undefined references when using pointer to member functions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 26 17:58:28 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=18074

            Bug ID: 18074
           Summary: Undefined references when using pointer to member
                    functions
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: rafael.espindola at gmail.com
                CC: joerg at NetBSD.org, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat test.cpp
#include <locale>

typedef char (std::moneypunct_byname<char,false>::*mbr)() const;
void g(mbr x);

int main() {
  g(&std::moneypunct_byname<char,false>::decimal_point);
}

$ cat test2.cpp
#include <locale>

typedef char (std::moneypunct_byname<char,false>::*mbr)() const;

void g(mbr x) {
}

$ clang++ -o test.so -shared -fPIC test.cpp test2.cpp
Undefined symbols for architecture x86_64:
  "std::__1::moneypunct<char, false>::decimal_point() const", referenced from:
      _main in test-c3f9f0.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


This works with libstdc++.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131127/d4b7398e/attachment.html>


More information about the llvm-bugs mailing list