If the typeinfo decls appear in OpenMP default(none) regions, as we no longer
predetermine const with no mutable members, they are diagnosed as errors,
but it isn't something the users can actually provide explicit sharing for in
the clauses.
2020-01-29 Jakub Jelinek <jakub@redhat.com>
PR c++/91118
* cp-gimplify.c (cxx_omp_predetermined_sharing): Return
OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
* g++.dg/gomp/pr91118-1.C: New test.
* g++.dg/gomp/pr91118-2.C: New test.
+2020-01-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/91118
+ * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
+ OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
+
2020-01-28 Jason Merrill <jason@redhat.com>
PR c++/93442
&& DECL_OMP_PRIVATIZED_MEMBER (decl)))
return OMP_CLAUSE_DEFAULT_SHARED;
+ /* Similarly for typeinfo symbols. */
+ if (VAR_P (decl) && DECL_ARTIFICIAL (decl) && DECL_TINFO_P (decl))
+ return OMP_CLAUSE_DEFAULT_SHARED;
+
return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
}
2020-01-29 Jakub Jelinek <jakub@redhat.com>
+ PR c++/91118
+ * g++.dg/gomp/pr91118-1.C: New test.
+ * g++.dg/gomp/pr91118-2.C: New test.
+
PR fortran/93463
* gfortran.dg/goacc/pr93463.f90: New test.
--- /dev/null
+// PR c++/91118
+// { dg-do compile }
+// { dg-additional-options "-fsanitize=undefined" }
+
+#include <iostream>
+
+void
+foo ()
+{
+#pragma omp parallel default(none) shared(std::cerr)
+ std::cerr << "hello" << std::endl;
+}
--- /dev/null
+// PR c++/91118
+// { dg-do compile }
+
+#include <typeinfo>
+
+struct S { virtual ~S (); };
+void bar (const std::type_info &, const std::type_info &);
+
+void
+foo (S *p)
+{
+ #pragma omp parallel default (none) firstprivate (p)
+ bar (typeid (*p), typeid (S));
+}