diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-03-23 19:52:37 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-03-23 19:52:37 -0500 |
commit | 7b1d6e6e1696c132335f74245455377038844749 (patch) | |
tree | ac5cb6b228615fac257930fe056fdad0934abe13 /gcc | |
parent | 06ed212d73c806a09939d57c57269f38928bd437 (diff) | |
download | gcc-7b1d6e6e1696c132335f74245455377038844749.zip gcc-7b1d6e6e1696c132335f74245455377038844749.tar.gz gcc-7b1d6e6e1696c132335f74245455377038844749.tar.bz2 |
(set_init_index): Check for use outside an array initializer.
From-SVN: r11607
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 48c93a0..683c15e 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -5737,6 +5737,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 |