From ba9bbd6f584afe2939c44c159cbb1c064becad5c Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 29 Aug 2016 16:41:33 +0000 Subject: Handle errors in both args of va_arg 2016-08-29 Tom de Vries 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. * gimplify.c (gimplify_va_arg_expr): Replace first argument type error with assert. * g++.dg/ext/va-arg1.C: Add error check for illegal first argument. From-SVN: r239827 --- gcc/gimplify.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 4715332..288b472 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -11959,12 +11959,7 @@ gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p, 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 % not of type %"); - 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. */ -- cgit v1.1