Commit 007db660 by Jakub Jelinek

re PR c++/51496 (FAIL: libgomp.c++/for-2.C * (test for excess errors))

	PR c++/51496
	* parser.c (cp_parser_omp_for_loop): When determining whether
	to use cp_parser_omp_for_incr or cp_parser_expression and when
	calling cp_parser_omp_for_incr, use real_decl instead of decl.

From-SVN: r182257
parent fe4bf59f
2011-12-12 Jakub Jelinek <jakub@redhat.com>
PR c++/51496
* parser.c (cp_parser_omp_for_loop): When determining whether
to use cp_parser_omp_for_incr or cp_parser_expression and when
calling cp_parser_omp_for_incr, use real_decl instead of decl.
2011-12-12 Torvald Riegel <triegel@redhat.com> 2011-12-12 Torvald Riegel <triegel@redhat.com>
* semantics.c (finish_transaction_stmt, build_transaction_expr): * semantics.c (finish_transaction_stmt, build_transaction_expr):
......
...@@ -26354,11 +26354,11 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses) ...@@ -26354,11 +26354,11 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
{ {
/* If decl is an iterator, preserve the operator on decl /* If decl is an iterator, preserve the operator on decl
until finish_omp_for. */ until finish_omp_for. */
if (decl if (real_decl
&& ((processing_template_decl && ((processing_template_decl
&& !POINTER_TYPE_P (TREE_TYPE (decl))) && !POINTER_TYPE_P (TREE_TYPE (real_decl)))
|| CLASS_TYPE_P (TREE_TYPE (decl)))) || CLASS_TYPE_P (TREE_TYPE (real_decl))))
incr = cp_parser_omp_for_incr (parser, decl); incr = cp_parser_omp_for_incr (parser, real_decl);
else else
incr = cp_parser_expression (parser, false, NULL); incr = cp_parser_expression (parser, false, NULL);
} }
......
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