Commit 76c5e6e0 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/27359 (ICE with missing initialization of iteration variable in parallel for loop)

	PR c++/27359
	* parser.c (cp_parser_omp_for_loop): Only call
	cp_parser_abort_tentative_parse if cp_parser_parse_definitely was not
	called.

	* g++.dg/gomp/pr27359.C: New test.

From-SVN: r113513
parent 0ef1a537
2006-05-04 Jakub Jelinek <jakub@redhat.com>
PR c++/27359
* parser.c (cp_parser_omp_for_loop): Only call
cp_parser_abort_tentative_parse if cp_parser_parse_definitely was not
called.
2006-05-02 Mark Mitchell <mark@codesourcery.com>
PR c++/27102
......
......@@ -18506,14 +18506,13 @@ cp_parser_omp_for_loop (cp_parser *parser)
pop_scope (pushed_scope);
}
}
else
cp_parser_abort_tentative_parse (parser);
/* If parsing as an initialized declaration failed, try again as
a simple expression. */
if (decl == NULL)
{
cp_parser_abort_tentative_parse (parser);
init = cp_parser_expression (parser, false);
}
init = cp_parser_expression (parser, false);
}
cp_parser_require (parser, CPP_SEMICOLON, "`;'");
pre_body = pop_stmt_list (pre_body);
......
2006-05-04 Jakub Jelinek <jakub@redhat.com>
PR c++/27359
* g++.dg/gomp/pr27359.C: New test.
2006-05-02 Steven G. Kargl <kargls@comcast.net>
PR fortran/20248
// PR c++/27359
// { dg-do compile }
void
foo ()
{
#pragma omp parallel for
for (int i; i < 1; ++i) // { dg-error "expected|was not declared" }
;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment