#include <stdarg.h> struct S { int f(int n) { return n; } }; void f(int i, ...) { va_list ap; va_start(ap, i); va_arg(ap, S).f(0); }
yields a bogus diagnostic and ICE with current mainline: t2.cc: In function 'void f(int, ...)': t2.cc:10: error: invalid lvalue in unary '&' tree check: expected class 'type', have 'exceptional' (error_mark) in pp_c_type_qualifier_list, at c-pretty-print.c:232 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. 4.0 also gives a bogus diagnostic: t2.cc: In function 'void f(int, ...)': t2.cc:10: error: invalid lvalue in unary '&' t2.cc:10: error: no matching function for call to 'S::f(int)' t2.cc:4: note: candidates are: int S::f(int) as does 3.4, while 3.3 compiles the test OK. -- Summary: [3.4/4.0/4.1 Regression] Bogus "invalid lvalue in unary '&'" diagnostic and ICE with va_arg Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jsm28 at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23840