From bb436d4eadf738d326ff7401bb4c00a78ee28aac Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 22 Jan 2008 17:25:37 +0000 Subject: 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 --- gcc/c-parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/c-parser.c') 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); -- cgit v1.2.1