+2016-08-29 Tom de Vries <tom@codesourcery.com>
+
+ PR c/77398
+ * gimplify.c (gimplify_va_arg_expr): Replace first argument type error
+ with assert.
+
2016-08-29 Eric Botcazou <ebotcazou@adacore.com>
* Makefile.in (gcov-iov.h): Add dummy recipe.
+2016-08-29 Tom de Vries <tom@codesourcery.com>
+
+ PR c/77398
+ * c-common.c (build_va_arg): Add first argument error. Build va_arg
+ with error_mark_node as va_list instead of with illegal va_list.
+
2016-08-25 Marek Polacek <polacek@redhat.com>
David Malcolm <dmalcolm@redhat.com>
{
tree va_type = TREE_TYPE (expr);
tree canon_va_type = (va_type == error_mark_node
- ? NULL_TREE
+ ? error_mark_node
: targetm.canonical_va_list_type (va_type));
if (va_type == error_mark_node
|| canon_va_type == NULL_TREE)
{
+ if (canon_va_type == NULL_TREE)
+ error_at (loc, "first argument to %<va_arg%> not of type %<va_list%>");
+
/* Let's handle things neutrallly, if expr:
- has undeclared type, or
- is not an va_list type. */
- return build_va_arg_1 (loc, type, expr);
+ return build_va_arg_1 (loc, type, error_mark_node);
}
if (TREE_CODE (canon_va_type) != ARRAY_TYPE)
if (have_va_type == error_mark_node)
return GS_ERROR;
have_va_type = targetm.canonical_va_list_type (have_va_type);
-
- if (have_va_type == NULL_TREE)
- {
- error_at (loc, "first argument to %<va_arg%> not of type %<va_list%>");
- return GS_ERROR;
- }
+ gcc_assert (have_va_type != NULL_TREE);
/* Generate a diagnostic for requesting data of a type that cannot
be passed through `...' due to type promotion at the call site. */
+2016-08-29 Tom de Vries <tom@codesourcery.com>
+
+ PR c/77398
+ * g++.dg/ext/va-arg1.C: Add error check for illegal first argument.
+
2016-08-29 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/ipa/iinline-attr.c: XFAIL on Visium.
void foo()
{
- ++__builtin_va_arg(0, A); // { dg-error "operand type is 'A'" }
+ ++__builtin_va_arg (0, A);
+ // { dg-error "operand type is 'A'" "" {target *-*-*} "7" }
+ // { dg-error "first argument to 'va_arg' not of type 'va_list'" "" {target *-*-*} "7" }
}