Path: 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 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.