openmp: c++: Consider typeinfo decls to be predetermined shared [PR91118]
authorJakub Jelinek <jakub@redhat.com>
Wed, 29 Jan 2020 08:41:42 +0000 (09:41 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 29 Jan 2020 08:41:42 +0000 (09:41 +0100)
commit8d7c0bf876fa784101f9ad9e3bba82cc065357da
tree98bb52b241add2c6cb1bf9354473a48199d9a236
parentaa1b56967d85bfc80d71341395f862ec2b30ca36
openmp: c++: Consider typeinfo decls to be predetermined shared [PR91118]

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.
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr91118-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/gomp/pr91118-2.C [new file with mode: 0644]