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.34.0 - bogus error Message-ID: <8903110137.AA08978@riunite.aca.mcc.com> Date: 11 Mar 89 01:37:22 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 25 The following code gets an error using G++ 1.34.0/Sun3. It shouldn't. Cut here ------------------------------------------------------------------------ /* Description - The c++ "manual" (p. 270) says that "... a declaration may add default arguments not given in previous declarations" This privledge should probably extend to method declarations and function declarations alike. The following code checks that a re-declaration of a method may add some new defaults. */ struct class1 { void method1 (int arg1, int arg2); void method1 (int arg1, int arg2 = 35); }; --------------------------------------------------------------------------- g++ -S x06.cc x06.cc:11: `void class1::method1 (int, int (= 35 ))' is already defined in aggregate scope // Ron Guilmette - MCC - Experimental (parallel) 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