re PR c++/58874 ([c++11] ICE with OpenMP reduction declaration and -std=c++11)

PR c++/58874
	* parser.c (cp_parser_late_parsing_for_member): For OpenMP UDRs
	pass 2 instead of 0 to finish_function.

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

From-SVN: r205412
This commit is contained in:
Jakub Jelinek 2013-11-26 21:39:56 +01:00 committed by Jakub Jelinek
parent 4ceffa27ee
commit 5999f07fba
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-11-26 Jakub Jelinek <jakub@redhat.com>
PR c++/58874
* parser.c (cp_parser_late_parsing_for_member): For OpenMP UDRs
pass 2 instead of 0 to finish_function.
2013-11-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58700

View File

@ -23275,7 +23275,7 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
{
parser->lexer->in_pragma = true;
cp_parser_omp_declare_reduction_exprs (member_function, parser);
finish_function (0);
finish_function (/*inline*/2);
cp_check_omp_declare_reduction (member_function);
}
else

View File

@ -1,5 +1,8 @@
2013-11-26 Jakub Jelinek <jakub@redhat.com>
PR c++/58874
* g++.dg/gomp/pr58874.C: New test.
PR middle-end/59150
* g++.dg/gomp/pr59150.C: New test.

View File

@ -0,0 +1,14 @@
// PR c++/58874
// { dg-do compile }
// { dg-options "-fopenmp" }
struct A
{
template<int> struct B
{
#pragma omp declare reduction (x : int : omp_out |= omp_in)
};
};
#pragma omp declare reduction (y : long : omp_out |= omp_in) \
initializer (omp_priv = 0)