aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2016-08-29 16:41:33 +0000
committerTom de Vries <vries@gcc.gnu.org>2016-08-29 16:41:33 +0000
commitba9bbd6f584afe2939c44c159cbb1c064becad5c (patch)
treebb66752a765b5b993a5ede281a590b42667c2c1d /gcc/gimplify.c
parent6c77dacd1cc70db30c4505966a7a636b78e292dd (diff)
downloadgcc-ba9bbd6f584afe2939c44c159cbb1c064becad5c.zip
gcc-ba9bbd6f584afe2939c44c159cbb1c064becad5c.tar.gz
gcc-ba9bbd6f584afe2939c44c159cbb1c064becad5c.tar.bz2
Handle errors in both args of va_arg
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. * 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
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c7
1 files changed, 1 insertions, 6 deletions
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 %<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. */