🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

G++

#1392
From: K3EES4_SU
Date: Thu, 21 Jan 1993 23:03
60 lines
1704 bytes
From:	NAME: K3/EES4-Schulz Kay            
	FUNC: K3/EES4                         
	TEL: 0711/811-20993                   <K3EES4_SU@SIIKS_A1@SIIKS>
To:	in%"gnu-g++@prep.ai.mit.edu"@gxlink

Dear Ladies and Gentlemen,
I am developping on an Ultrix 4.2 and I use your 
g++ 1.4
and gcc 2.1

I can't read news so I have a question if the following is a 
bug of this old version or not!

I have a base class and a derived class. I use destructors:
e.g.
class A
{
	A(); //Constr.
	virtual ~A(); //DESTR.
	//body
}
class B:public A
{
	B();	//Constr.
	~B():	//Destr.
	//more code
}
Stroustrup says this should work, it produces the following output:
_$_8A
_$_20B

Why?
If I use this:
class A
{
	A();
	~A();
	//virtual functions following
}
class B
{
	B();
	//code for virtual functions in class a or definition
}
I get the output:
warning: class A has virtual functions but non-virtual destructor.

I need help, else I can't go on working, or only withou
destructors . Is a bug of your compiler or linker and is fixed
in the newer versions or is it a feature or is it correct?

Thanks

KAY SCHULZ
k3ees4_su@siiks_a1.bosch.de
Falkenweg 9
7120 Bietigheim-Bissingen
GERMANY
Tel. private: 0049714265643
Tel. Job: 004971181120993
Technical Details
Message-ID: <01GTRUMWONTE0007YD@XLINK2.IRA.UKA.DE>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!siiks_a1.bosch.DE!K3EES4_SU

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!siiks_a1.bosch.DE!K3EES4_SU
From: K3EES4_SU@siiks_a1.bosch.DE
Newsgroups: gnu.g++.bug
Subject: G++
Date: 21 Jan 1993 18:03:47 -0500
Organization: GNUs Not Usenet
Lines: 62
Sender: daemon@cis.ohio-state.edu
Approved: bug-g++@prep.ai.mit.edu
Distribution: gnu
Message-ID: <01GTRUMWONTE0007YD@XLINK2.IRA.UKA.DE>