This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch for va_arg and references


> 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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]