This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for va_arg and references
- To: mark at codesourcery dot com
- Subject: Re: Patch for va_arg and references
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Fri, 7 Apr 2000 12:53:17 -0700
- CC: gcc-bugs at gcc dot gnu dot org
- References: <200004070938.CAA24190@vaio.codesourcery.com>
> Date: Fri, 7 Apr 2000 02:38:51 -0700
> From: Mark Mitchell <mark@codesourcery.com>
> Cc: gcc-bugs@gcc.gnu.org
> Reply-to: mark@codesourcery.com
>
>
> Geoff --
>
> Your recent patch to c-common.c breaks these test cases:
>
> FAIL: g++.jason/thunk3.C (test for excess errors)
> FAIL: g++.other/vaarg1.C (test for excess errors)
> FAIL: g++.other/vaarg2.C (test for excess errors)
> FAIL: g++.pt/vaarg.C (test for excess errors)
>
> on i686-pc-linux-gnu.
Odd. I tested on that exact configuration. I'll try again.
> The reason is that `&ap' is not an lvalue in C++ (even though `ap'
> is), and references must be bound to lvalues. Effectively, we've now
> got:
>
> extern void va_start (void *&);
> void *ap;
> va_start (&ap);
How do we get &ap? It should be
va_start (ap)
which was the whole point of the patch. Perhaps you have some old
header files lying around?
> which isn't legal C++.
Yes, it's a type mismatch.
--
- Geoffrey Keating <geoffk@cygnus.com>