eb fix 3

Robert Lipe robertl@dgii.com
Thu May 28 23:08:00 GMT 1998


Martin von Loewis wrote:
> This code should produce a message, and does so. Earlier versions
> appearantly didn't, so we should keep the case.

Again, the message that this triggers for me differs than the one you
coded below.

Are we emitting the wrong message, or are you running something other than
what I'm running?

/net/rjlhome/home/play/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C:11: d
efault argument given for parameter 1 of `void A::f(int = 1)'
/net/rjlhome/home/play/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C:6: af
ter previous specification in `void A::f(int = 1)'

FAIL: g++.robertl/eb121.C duplicate default argument (test for errors, line 10)
FAIL: g++.robertl/eb121.C (test for excess errors)
/net/rjlhome/home/play/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C:11: d
efault argument given for parameter 1 of `void A::f(int = 1)'
/net/rjlhome/home/play/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C:6: af
ter previous specification in `void A::f(int = 1)'
                                                                               



> 
> Martin
> 
> Index: eb121.C
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C,v
> retrieving revision 1.1
> diff -c -p -r1.1 eb121.C
> *** eb121.C	1998/05/27 23:00:35	1.1
> --- eb121.C	1998/05/28 19:13:56
> ***************
> *** 1,13 ****
> ! // Compiles.   Shouldn't.
>   class A {
>   private:
>     int i1_;
>   public:
> !   void f(int const i1 = 1);
>   };
>   
>   void
> ! A::f(int const i1 = 1) // !!! SHOULD TRIGGER AN ERROR !!!
>   {
>     i1_ = i1;
>   }
> --- 1,13 ----
> ! //Build don't link:
>   class A {
>   private:
>     int i1_;
>   public:
> !   void f(int const i1 = 1); // ERROR -
>   };
>   
>   void
> ! A::f(int const i1 = 1) // ERROR - duplicate default argument
>   {
>     i1_ = i1;
>   }
> 

-- 
Robert Lipe       http://www.dgii.com/people/robertl       robertl@dgii.com
              (WEB ADDRESS MAY BE TEMPORARILY UNAVAILABLE)





More information about the Gcc-patches mailing list