re PR c++/81011 (ICE with #pragma omp task and inaccessible copy-constructor)

PR c++/81011
	* cp-gimplify.c (cxx_omp_finish_clause): When changing clause
	to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
	and OMP_CLAUSE_SHARED_READONLY flags.

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

From-SVN: r249032
This commit is contained in:
Jakub Jelinek 2017-06-08 21:02:09 +02:00 committed by Jakub Jelinek
parent 854e6816b8
commit d5e8341185
4 changed files with 36 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2017-06-08 Jakub Jelinek <jakub@redhat.com>
PR c++/81011
* cp-gimplify.c (cxx_omp_finish_clause): When changing clause
to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
and OMP_CLAUSE_SHARED_READONLY flags.
2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_base_specifier): Fix typos in error messages.

View File

@ -1944,7 +1944,11 @@ cxx_omp_finish_clause (tree c, gimple_seq *)
make_shared = true;
if (make_shared)
OMP_CLAUSE_CODE (c) = OMP_CLAUSE_SHARED;
{
OMP_CLAUSE_CODE (c) = OMP_CLAUSE_SHARED;
OMP_CLAUSE_SHARED_FIRSTPRIVATE (c) = 0;
OMP_CLAUSE_SHARED_READONLY (c) = 0;
}
}
/* Return true if DECL's DECL_VALUE_EXPR (if any) should be

View File

@ -1,3 +1,8 @@
2017-06-08 Jakub Jelinek <jakub@redhat.com>
PR c++/81011
* g++.dg/gomp/pr81011.C: New test.
2017-06-07 Richard Biener <rguenther@suse.de>
Backport from mainline

View File

@ -0,0 +1,19 @@
// PR c++/81011
// { dg-do compile }
class A { A (const A&); }; // { dg-message "declared private here" }
void foo (const A&);
void
bar (A& a)
{
#pragma omp task // { dg-error "is private within this context" }
foo (a);
}
void
baz (A& a)
{
#pragma omp task firstprivate (a) // { dg-error "is private within this context" }
foo (a);
}