diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-22 17:25:37 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-22 17:25:37 +0000 |
commit | bb436d4eadf738d326ff7401bb4c00a78ee28aac (patch) | |
tree | 1c406740b0055c955a3dfd59b712cbd0ff764cc9 /gcc/c-parser.c | |
parent | 2cb0e5d93bd600a6ed3781755c8080f8ae2db74c (diff) | |
download | gcc-bb436d4eadf738d326ff7401bb4c00a78ee28aac.tar.gz |
PR c++/34607
* c-parser.c (c_parser_omp_for_loop): Don't call c_finish_omp_for
if DECL_INITIAL (decl) is error_mark_node.
* semantics.c (finish_omp_for): Don't call c_finish_omp_for
if decl or init is error_mark_node.
* gcc.dg/gomp/pr34607.c: New test.
* g++.dg/gomp/pr34607.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131730 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 107b114d469..72f8a21c0fe 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -7547,6 +7547,8 @@ c_parser_omp_for_loop (c_parser *parser) decl = check_for_loop_decls (); if (decl == NULL) goto error_init; + if (DECL_INITIAL (decl) == error_mark_node) + decl = error_mark_node; init = decl; } else if (c_parser_next_token_is (parser, CPP_NAME) @@ -7597,7 +7599,7 @@ c_parser_omp_for_loop (c_parser *parser) c_break_label = save_break; c_cont_label = save_cont; - /* Only bother calling c_finish_omp_for if we havn't already generated + /* Only bother calling c_finish_omp_for if we haven't already generated an error from the initialization parsing. */ if (decl != NULL && decl != error_mark_node && init != error_mark_node) return c_finish_omp_for (loc, decl, init, cond, incr, body, NULL); |