https://llvm.org/bugs/show_bug.cgi?id=28997
Bug ID: 28997 Summary: "non-virtual thunk" abi_tag mangling is different from g++ Product: clang Version: 3.9 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Frontend Assignee: unassignedclangb...@nondot.org Reporter: joubert...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Hi, This is an upstream bug report for the following Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834492 The new mangling behavior of clang++ for GCC abi_tag attribute seems to be different from the g++ one on some edge cases. Consider the following code: $ cat classes.hpp #include <string> struct Mother { virtual ~Mother() {}; int bar; }; struct Father { virtual std::string get_foo() = 0; }; class Derived: public Mother, public Father { public: std::string get_foo(); }; $ cat classes.cpp #include "classes.hpp" std::string Derived::get_foo() { return ""; } $ cat main.cpp #include "classes.hpp" struct Final: public Derived { }; int main() { Final().get_foo(); } When compiling the classes with clang++ and trying to link the executable with g++ one gets the following link error: $ clang++-3.9 -c classes.cpp && g++-5 main.cpp classes.o /tmp/cchpctTt.o:main.cpp:vtable for Final : erreur : référence à « non- virtual thunk to Derived::get_foo() » non définie collect2: error: ld returned 1 exit status And it seems this symbol is mangled differently by clang++ and g++: $ clang++-3.9 -c classes.cpp && nm -C classes.o | grep get_foo 0000000000000000 T Derived::get_foo[abi:cxx11]() 0000000000000070 T non-virtual thunk to Derived::get_foo[abi:cxx11]() $ g++-5 -c classes.cpp && nm -C classes.o | grep get_foo 0000000000000000 T Derived::get_foo[abi:cxx11]() 0000000000000065 T non-virtual thunk to Derived::get_foo() $ g++-6 -c classes.cpp && nm -C classes.o | grep get_foo 0000000000000000 T Derived::get_foo[abi:cxx11]() 0000000000000065 T non-virtual thunk to Derived::get_foo() -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs