Skip to content

Undefined references when using pointer to member functions #18448

@llvmbot

Description

@llvmbot
Bugzilla Link 18074
Resolution INVALID
Resolved on Jun 26, 2019 13:32
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @jsonn,@mclow,@zygoloid

Extended Description

$ cat test.cpp
#include

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

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++.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillainvalidResolved as invalid, i.e. not a buglibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions