summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc/c-typeck.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/gcc/c-typeck.c')
-rw-r--r--gnu/usr.bin/gcc/c-typeck.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gnu/usr.bin/gcc/c-typeck.c b/gnu/usr.bin/gcc/c-typeck.c
index e9d6b2a4196..bae52e323f4 100644
--- a/gnu/usr.bin/gcc/c-typeck.c
+++ b/gnu/usr.bin/gcc/c-typeck.c
@@ -5723,6 +5723,8 @@ set_init_index (first, last)
error_init ("nonconstant array index in initializer%s", " for `%s'", NULL);
else if (last != 0 && TREE_CODE (last) != INTEGER_CST)
error_init ("nonconstant array index in initializer%s", " for `%s'", NULL);
+ else if (! constructor_unfilled_index)
+ error_init ("array index in non-array initializer%s", " for `%s'", NULL);
else if (tree_int_cst_lt (first, constructor_unfilled_index))
error_init ("duplicate array index in initializer%s", " for `%s'", NULL);
else