Patch for va_arg and references
Mark Mitchell
mark@codesourcery.com
Fri Apr 7 01:30:00 GMT 2000
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.
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);
which isn't legal C++.
-- Mark
More information about the Gcc-bugs
mailing list