🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ allows definition of base destructor in derived class

#1536
From: "Douglas C. Schmidt"
Date: Tue, 22 Nov 1988 06:31
28 lines
1241 bytes
Hi,

   I believe the following is quite erroneous, however, g++ 1.27 accepts
it without complaint:

----------------------------------------
class foo {
public:
   foo () {}   
};

class bar : foo {
   bar() {}
  ~foo() {} // yow, let's define foo's destructor in derived class bar!
};

main () { }
----------------------------------------

CC 1.2.1 obviously complains that ~foo declared in bar is an error!

Doug
----------------------------------------
schmidt@bonnie.ics.uci.edu (ARPA) |   Per me si va nella cita dolente.
                                  |   Per me si va nell' etterno dolore.
                                  |   Per me si va tra la perduta gente.
                                  |   Lasciate ogni speranza voi ch' entrate.
Technical Details
Message-ID: <8811212231.aa12010@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%glacier.ics.uci.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%glacier.ics.uci.edu
From: schmidt%glacier.ics.uci.edu@ORION.CF.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.g++.bug
Subject: g++ allows definition of base destructor in derived class
Message-ID: <8811212231.aa12010@PARIS.ICS.UCI.EDU>
Date: 22 Nov 88 06:31:52 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 28