🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ permits erroneous redeclaration of propated class members

#1535
From: "Douglas C. Schmidt"
Date: Tue, 22 Nov 1988 01:15
44 lines
1539 bytes
Hi,

   I believe the following is a rather benign error on the part of g++
1.27.  AT&T cfront flags the redeclaration of the parameter types for
member Print as an error, whereas g++ doesn't complain:

----------------------------------------
class Foo {
private:
   int Y;
public:
   Foo ( int X ) {
      Y = X;
   }   
   int Print ( void ) { // declare Print as taking no parameters
      cout << "Y = " << Y << "\n";
   }
};

class Bar : Foo {
public:
   Foo::Print ( int ); // should not be accepted
};

class Foo_Bar : Bar {
public:
   Bar::Print ( double ); // ditto
};

main () {
   Foo_Bar X ( 10 ); 
   X.Print (); 
}
----------------------------------------

thanks,

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: <8811211715.aa08578@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!mailrus!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%blanche.ics.uci.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!mailrus!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%blanche.ics.uci.edu
From: schmidt%blanche.ics.uci.edu@ORION.CF.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.g++.bug
Subject: g++ permits erroneous redeclaration of propated class members
Message-ID: <8811211715.aa08578@PARIS.ICS.UCI.EDU>
Date: 22 Nov 88 01:15:39 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 44