diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-11-06 18:51:20 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-11-06 18:51:20 +0100 |
commit | 2e3135726b941c5d1cd87d1905678a7533ed7d4d (patch) | |
tree | fd226186e450455912c053a4fc79f6b80c4c606b /gcc/cp | |
parent | 79af7c1f6d8a41e7d2c9f8c3c4541eceddef0284 (diff) | |
download | gcc-2e3135726b941c5d1cd87d1905678a7533ed7d4d.zip gcc-2e3135726b941c5d1cd87d1905678a7533ed7d4d.tar.gz gcc-2e3135726b941c5d1cd87d1905678a7533ed7d4d.tar.bz2 |
re PR c++/41967 (gcc get into endless loop when compiling an openmp program)
PR c++/41967
* parser.c (cp_parser_omp_for_loop): After diagnosing not perfectly
nested loop and parsing statements, don't cp_parser_require }, instead
exit the loop if next token is CPP_EOF.
* g++.dg/gomp/pr41967.C: New test.
From-SVN: r153972
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/parser.c | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e909ba2..21a2221 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2009-11-06 Jakub Jelinek <jakub@redhat.com> + + PR c++/41967 + * parser.c (cp_parser_omp_for_loop): After diagnosing not perfectly + nested loop and parsing statements, don't cp_parser_require }, instead + exit the loop if next token is CPP_EOF. + 2009-11-05 Jason Merrill <jason@redhat.com> PR c++/34180 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 28fcabc..1d677cb 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -22424,7 +22424,8 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses) } collapse_err = true; cp_parser_statement_seq_opt (parser, NULL); - cp_parser_require (parser, CPP_CLOSE_BRACE, "%<}%>"); + if (cp_lexer_next_token_is (parser->lexer, CPP_EOF)) + break; } } |