aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-parser.cc')
-rw-r--r--gcc/c/c-parser.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 9398c7a..c9f0693 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -5677,11 +5677,14 @@ c_parser_initializer (c_parser *parser, tree decl)
{
struct c_expr ret;
location_t loc = c_parser_peek_token (parser)->location;
- if (decl != error_mark_node && C_DECL_VARIABLE_SIZE (decl))
- error_at (loc,
- "variable-sized object may not be initialized except "
- "with an empty initializer");
ret = c_parser_expr_no_commas (parser, NULL);
+ if (decl != error_mark_node && C_DECL_VARIABLE_SIZE (decl))
+ {
+ error_at (loc,
+ "variable-sized object may not be initialized except "
+ "with an empty initializer");
+ ret.set_error ();
+ }
/* This is handled mostly by gimplify.cc, but we have to deal with
not warning about int x = x; as it is a GCC extension to turn off
this warning but only if warn_init_self is zero. */