Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MCC.COM!rfg From: rfg@MCC.COM (Ron Guilmette) Newsgroups: gnu.g++.bug Subject: BUG in G++ 1.35.0 (b088) Message-ID: <8907022048.AA09016@pink.aca.mcc.com> Date: 2 Jul 89 20:48:09 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32 The following test, when compiled with G++ 1.35.0.0/sun3 generates no errors. I believe that an error should be generated on the line indicated. This would be in keeping with general philosophy that says that private data members may only be accessed (i.e. read/written) by member functions. --------------------------------------------------------------------- // Check that initialization of private data members is illegal // except via the use of an explicit constructor. class friendly; class base { int data_member_1; // private data member public: int data_member_2; friend class friendly; // prevent warnings void function_member (); }; void test () { base object = { 3, 5 }; // ERROR object.function_member (); // prevent warnings } --------------------------------------------------------------------- // Ron Guilmette - MCC - Experimental Systems Kit Project // 3500 West Balcones Center Drive, Austin, TX 78759 - (512)338-3740 // ARPA: rfg@mcc.com // UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg