Path: utzoo!telly!attcan!uunet!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- Message-ID: <8904272241.AA04850@riunite.aca.mcc.com> Date: 27 Apr 89 22:41:56 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 38 The following file fails compilation when using G++ 1.35.0- on a Sun3. This same file passes compilation (without errors or warnings) when using g++ 1.34.1. I believe that it is legal code and should pass. ------------------------------------------------------------------------- // Check that if explicit conversion (to a base type) is used, // the compiler can still find a proper (implicitly generated) // initialization member function to apply to the converted value. struct base { int base_member; base () {} //base (const base& br) { *this = br; } // This makes it work. }; struct derived : public base { int derived_member; }; base base_object; int main () { derived derived_object; base_object = (base) derived_object; return 0; } ------------------------------------------------------------------------- /usr/local/src/src/g++/build/sun3/1.35-.0-.0/g++ -B/usr/local/src/src/g++/build/sun3/1.35-.0-.0/ -Wall -Wwrite-strings -ansi -pedantic -S -v a026.C In function int main (): a026.C:22: too many arguments to function // 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