aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2016-08-29 16:41:42 +0000
committerTom de Vries <vries@gcc.gnu.org>2016-08-29 16:41:42 +0000
commitf162d717123453da23ee76c8b2aab1572211fb9c (patch)
treea3fd5b03ed5457d7fe5e06d70e297eebc856ba99 /gcc
parentba9bbd6f584afe2939c44c159cbb1c064becad5c (diff)
downloadgcc-f162d717123453da23ee76c8b2aab1572211fb9c.zip
gcc-f162d717123453da23ee76c8b2aab1572211fb9c.tar.gz
gcc-f162d717123453da23ee76c8b2aab1572211fb9c.tar.bz2
Replace error_at with assert in build_va_arg
2016-08-29 Tom de Vries <tom@codesourcery.com> * c-common.c (build_va_arg): Replace first argument type error with assert. From-SVN: r239828
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-common.c14
2 files changed, 7 insertions, 12 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index b6876d4..157adc9 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,5 +1,10 @@
2016-08-29 Tom de Vries <tom@codesourcery.com>
+ * c-common.c (build_va_arg): Replace first argument type error
+ with assert.
+
+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.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index eef8674..3d4e97b 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5832,12 +5832,7 @@ build_va_arg (location_t loc, tree expr, tree type)
/* Verify that &ap is still recognized as having va_list type. */
tree canon_expr_type
= targetm.canonical_va_list_type (TREE_TYPE (expr));
- if (canon_expr_type == NULL_TREE)
- {
- error_at (loc,
- "first argument to %<va_arg%> not of type %<va_list%>");
- return error_mark_node;
- }
+ gcc_assert (canon_expr_type != NULL_TREE);
return build_va_arg_1 (loc, type, expr);
}
@@ -5905,12 +5900,7 @@ build_va_arg (location_t loc, tree expr, tree type)
/* Verify that &ap is still recognized as having va_list type. */
tree canon_expr_type
= targetm.canonical_va_list_type (TREE_TYPE (expr));
- if (canon_expr_type == NULL_TREE)
- {
- error_at (loc,
- "first argument to %<va_arg%> not of type %<va_list%>");
- return error_mark_node;
- }
+ gcc_assert (canon_expr_type != NULL_TREE);
}
else
{