Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!bloom-beacon!oberon!orion.cf.uci.edu!paris.ics.uci.edu!glacier.ics.uci.edu!schmidt From: schmidt@glacier.ics.uci.edu (Doug Schmidt) Newsgroups: comp.lang.c++ Subject: constructors and derived types Message-ID: <960@paris.ics.uci.edu> Date: 22 Nov 88 06:21:04 GMT Sender: news@paris.ics.uci.edu Reply-To: Doug Schmidt Organization: University of California, Irvine - Dept of ICS Lines: 40 Hi, Can someone please inform me as to whether the following is legitimate C++: ---------------------------------------- class Foo { // A much simplified example public: Foo ( void ) { } }; class Foo_Bar : Foo { // Foo is a non-public base class and Foo_Bar has no constructor public: }; main () { Foo_Bar X; } ---------------------------------------- cfront 1.2.1 complains that: ---------------------------------------- CC question.C: "question.C", line 5: error: Foo::Foo() is from a private base class 1 error ---------------------------------------- but G++ 1.27 compiles it without a squawk. If a constructor is added to Foo_Bar, then cfront accepts it also. thanks, Doug Schmidt -- 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.