This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++: why implicit delete in destructor?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]