Commit 34361776 by Jakub Jelinek Committed by Jakub Jelinek

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: r249031
parent 0d05f685
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-08 Jan Hubicka <hubicka@ucw.cz>
* cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
......
......@@ -1912,7 +1912,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
......
2017-06-08 Jakub Jelinek <jakub@redhat.com>
PR c++/81011
* g++.dg/gomp/pr81011.C: New test.
PR middle-end/81005
* c-c++-common/ubsan/align-10.c: New test.
* c-c++-common/ubsan/null-13.c: New test.
......
// 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);
}
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