http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58297
Bug ID: 58297 Summary: wrong DTOR call is generated when virtual base is present Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: kcc at gcc dot gnu.org For some reason, g++ (r202164) generates a call to an incorrect DTOR, but never generates the DTOR itself. As the result, we get this link error: undefined reference to `BBB::~BBB(void const**)' The test case is reduced from Chromium sources, https://code.google.com/p/chromium/issues/detail?id=282285 % head z.h z1.cc z2.cc ==> z.h <== struct AAA { }; struct BBB: virtual AAA { ~BBB (); }; ==> z1.cc <== #include "z.h" BBB::~BBB() { } int main() { } ==> z2.cc <== #include "z.h" struct CCC: BBB { ~CCC (); }; CCC::~CCC () { } % % g++ z1.cc z2.cc # 4.6.3 % clang++ z1.cc z2.cc # fresh trunk % $FRESH_GCC/bin/g++ z1.cc z2.cc /tmp/ccO8JGGF.o: In function `CCC::~CCC()': z2.cc:(.text+0x31): undefined reference to `BBB::~BBB(void const**)' /tmp/ccO8JGGF.o: In function `CCC::~CCC()': z2.cc:(.text+0x6a): undefined reference to `BBB::~BBB(void const**)' collect2: error: ld returned 1 exit status