Commit 2e313572 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 79af7c1f
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
......
......@@ -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;
}
}
......
2009-11-06 Jakub Jelinek <jakub@redhat.com>
PR c++/41967
* g++.dg/gomp/pr41967.C: New test.
2009-11-06 Michael Matz <matz@suse.de>
PR middle-end/41963
......
// PR c++/41967
// { dg-do compile }
// { dg-options "-fopenmp" }
int
foo ()
{
int sum = 0;
#pragma omp for collapse(2)
for (int i = 0; i < 5; ++i)
{
for (int j = 0; j < 5; ++j)
++sum;
++sum; // { dg-error "collapsed loops not perfectly nested" }
}
return sum;
}
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