diff options
author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-14 21:35:47 +0000 |
---|---|---|
committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-14 21:35:47 +0000 |
commit | 2fa95deeefd95f5c77c0a0ac67a13079f087c37a (patch) | |
tree | 30cd3681486ae4b2227a082c326aee6d97bb53a6 /gcc/c-parser.c | |
parent | 2d42b7d7e7dc1636970d6443d3a3c7e22159c0e3 (diff) | |
download | gcc-2fa95deeefd95f5c77c0a0ac67a13079f087c37a.tar.gz |
PR c/23439
* c-parser.c (c_parser_for_statement): Use location of RID_FOR
to initialize loc.
* gcc.dg/for-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105422 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index ce035694fd2..518a92ce9f5 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -3776,8 +3776,9 @@ static void c_parser_for_statement (c_parser *parser) { tree block, cond, incr, save_break, save_cont, body; - location_t loc = UNKNOWN_LOCATION; + location_t loc; gcc_assert (c_parser_next_token_is_keyword (parser, RID_FOR)); + loc = c_parser_peek_token (parser)->location; c_parser_consume_token (parser); block = c_begin_compound_stmt (flag_isoc99); if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) |