aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parse.in
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@redhat.com>2000-12-29 08:27:40 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2000-12-29 08:27:40 +0000
commitfb8b656c65ec5df2bf16a8eb636577e8be619244 (patch)
tree74df938ddc4fd9f854f62e5d03857b48c466e7c5 /gcc/c-parse.in
parent68940175460a147340617aa400213b32fda99fc4 (diff)
downloadgcc-fb8b656c65ec5df2bf16a8eb636577e8be619244.zip
gcc-fb8b656c65ec5df2bf16a8eb636577e8be619244.tar.gz
gcc-fb8b656c65ec5df2bf16a8eb636577e8be619244.tar.bz2
c-parse.in (select_or_iter_stmt): Use truthvalue_conversion on the condition of a FOR statement...
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
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r--gcc/c-parse.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 8b211d1..f944ac3 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -1896,7 +1896,8 @@ select_or_iter_stmt:
{ 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