This is the mail archive of the gcc-bugs@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: operator delete() redefinition errors.


Wegher, Jeff <JWegher@neonsoft.com> writes:

> Running the 980517 snapshot of egcs (egcs-2.91.29) under
> Solaris 2.51 with no special compile options, I'm seeing some
> weird behavior when redefining operator delete() in my classes.

> class Base { public: virtual ~Base() { }
> void operator delete(void*pMemory) { ::operator delete(pMemory); } };
> class Derived : public Base { public:
> void operator delete(void*pMemory) { Base::operator delete(pMemory); } };
> class VirtualDerived : virtual public Base { public:
> void operator delete(void* pMemory) { Base::operator delete(pMemory); } > };
> int main() { Base* pBase = new Base; Derived* pDerived = new
> Derived; VirtualDerived* pVirtualDerived = new VirtualDerived; }

> no suitable operator delete for `Derived'
> no suitable operator delete for `VirtualDerived'

I couldn't reproduce this problem on Solaris 2.6 with the latest
snapshot of egcs, so I believe it is fixed.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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