[Bug c++/59246] GCC should issue runtime error for calling pure virtual function with definition

boostcpp at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Nov 22 07:07:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59246

--- Comment #1 from Ryou Ezoe <boostcpp at gmail dot com> ---
According to the de facto standard C++ ABI:
http://mentorembedded.github.io/cxx-abi/abi.html#pure-virtual

__cxa_pure_virtual will be called:
> if the user calls a non-overridden pure virtual function, which has undefined
> behavior according to the C++ Standard. 

When this abstract class Base's destructor was called,
class objects derived from Base are already destructed.

So it is non-overridden and it is also undefined behavior.



More information about the Gcc-bugs mailing list