https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77398
Bug ID: 77398
Summary: first argument to va_arg not of type va_list error
hidden by other error
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
Consider test-case:
...
struct A {};
void
foo (void)
{
__builtin_va_arg (0, A);
}
...
Compiling this with g++ gives the error:
...
error: first argument to ‘va_arg’ not of type ‘va_list’
...
Now we add ++ in front of the expression, and get:
...
struct A {};
void
foo (void)
{
++__builtin_va_arg (0, A);
}
...
Compiling this with g++ gives this error:
...
error: no match for ‘operator++’ (operand type is ‘A’)
...
and the previous error disappears.
The errors are independent, and there's no reason why both can't appear.