This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: eb fix 3
- To: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>, egcs-patches at cygnus dot com
- Subject: Re: eb fix 3
- From: Robert Lipe <robertl at dgii dot com>
- Date: Fri, 29 May 1998 00:59:52 -0500
- References: <199805281919.VAA06889@mira.isdn.cs.tu-berlin.de>
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)