This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++: why implicit delete in destructor?
- To: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Subject: Re: C++: why implicit delete in destructor?
- From: Olaf Dietsche <olaf dot dietsche--list dot gcc-patches at exmail dot de>
- Date: 30 Apr 2001 22:10:22 +0200
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- References: <87n18zh0p2.fsf@tigram.bogus.local><20010501041307.A21171@hg.cs.mu.oz.au>
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.