🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1033

Problem with g++ 2.2.2

#1033
From: jim
Date: Wed, 07 Oct 1992 18:08
32 lines
1246 bytes
In the following program the definition for the delete overload for class A
has to be the void * argument. If either of the alternatives (no arguments or
(void *, size_t)) are used then the compiler complains about the wrong number
of arguments when compiling the class B  destructor. Why should the B
destructor be referencing A's delete function anyway? It never called, as
running the code will show you. I think that this is a problem in the compiler.
Am I right? The code compiles fine with the AT&T compiler.

Thanks in advance,

Confused of Ipswich.

#include <stdio.h>

class A
{
public:
	void	operator delete (void *x)
		{ printf ("A delete arg = %x.\n", x); }
};

class B : public A
{
public:
	~ B ()
		{ printf ("B gone.\n"); }
};

main (int argc, char *argv [])
{
	B	b;
}
Technical Details
Message-ID: <8711.9210071608@garland.garland.bt.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!garland.bt.co.UK!jim

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!garland.bt.co.UK!jim
From: jim@garland.bt.co.UK
Subject: Problem with g++ 2.2.2
Message-ID: <8711.9210071608@garland.garland.bt.co.uk>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 7 Oct 1992 18:08:07 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 34