This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/77398] New: first argument to va_arg not of type va_list error hidden by other error
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Aug 2016 06:49:21 +0000
- Subject: [Bug c/77398] New: first argument to va_arg not of type va_list error hidden by other error
- Auto-submitted: auto-generated
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.