2000-12-28 Geoffrey Keating <geoffk@redhat.com>
* c-parse.in (select_or_iter_stmt): Use truthvalue_conversion
on the condition of a FOR statement, so that it gets typechecked
and optimised.
2000-12-28 Geoffrey Keating <geoffk@redhat.com>
* gcc.dg/noncompile/
20001228-1.c: New test.
From-SVN: r38527
+2000-12-28 Geoffrey Keating <geoffk@redhat.com>
+
+ * c-parse.in (select_or_iter_stmt): Use truthvalue_conversion
+ on the condition of a FOR statement, so that it gets typechecked
+ and optimised.
+
2000-12-29 Alexandre Oliva <aoliva@redhat.com>
* c-decl.c (grokdeclarator): Prevent crash in case of overflow in
{ stmt_count++;
RECHAIN_STMTS ($<ttype>2, FOR_INIT_STMT ($<ttype>2)); }
xexpr ';'
- { FOR_COND ($<ttype>2) = $6; }
+ { if ($6)
+ FOR_COND ($<ttype>2) = truthvalue_conversion ($6); }
xexpr ')'
{ FOR_EXPR ($<ttype>2) = $9; }
c99_block_lineno_labeled_stmt
2000-12-28 Geoffrey Keating <geoffk@redhat.com>
+ * gcc.dg/noncompile/20001228-1.c: New test.
+
* gcc.dg/20001228-1.c: New test.
* gcc.c-torture/execute/20001228-1.c: New test.
--- /dev/null
+void rof(void)
+{
+ union { int a; } u;
+ for (u.a = 0; u; u.a++) /* { dg-error "invalid operand" } */
+ ;
+}