C++: why implicit delete in destructor?
Olaf Dietsche
olaf.dietsche--list.gcc-patches@exmail.de
Mon Apr 30 13:15:00 GMT 2001
Hi,
Fergus Henderson <fjh@cs.mu.oz.au> writes:
> > Comments anybody? Did I miss something?
>
> Does this patch handle the case of classes with overloaded operator delete
> and virtual destructors?
No, it doesn't.
> This example should output
>
> ~Derived()
> ~Base()
> Derived::operator delete()
The example output is:
~Derived()
~Base()
Base::operator delete()
> In other words, operator delete() acts as it if was virtual iff the
> destructor is declared virtual.
Thanks for pointing this out. So, the patch works only for really
simple cases. Are there other cases to consider? Is this example part
of the g++-3.0 testsuite?
Regards, Olaf.
More information about the Gcc
mailing list