Commit 37e05cd5 by Mark Mitchell Committed by Mark Mitchell

* init.c (expand_vec_init): Fix off-by-one error.

From-SVN: r23506
parent 0ae9f65b
1998-11-02 Mark Mitchell <mark@markmitchell.com>
* init.c (expand_vec_init): Fix off-by-one error.
1998-11-02 Alexandre Oliva <oliva@dcc.unicamp.br>
* parse.y (apparent_template_type): new type
......
......@@ -2853,10 +2853,10 @@ expand_vec_init (decl, base, maxindex, init, from_array)
&& !(TREE_CODE (maxindex) == INTEGER_CST
&& num_initialized_elts == TREE_INT_CST_LOW (maxindex) + 1))
{
/* If the ITERATOR is equal to zero, then we don't have to loop;
/* If the ITERATOR is equal to -1, then we don't have to loop;
we've already initialized all the elements. */
expand_start_cond (build (NE_EXPR, boolean_type_node,
iterator, integer_zero_node),
iterator, minus_one),
0);
/* Otherwise, loop through the elements. */
......
int i;
struct D {
D () {
i++;
}
};
struct C {
C() {}
D d[1];
};
int main ()
{
C c;
if (i != 1)
return 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment