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
+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.
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.
--- /dev/null
+// 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);
+}