gcc/fortran/ChangeLog:
* openmp.cc (resolve_omp_clauses): Reject groupprivate/device-local
variables in MAP clauses.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/groupprivate-7.f90: New test.
&n->where);
}
}
+ if (list == OMP_LIST_MAP
+ && (n->sym->attr.omp_groupprivate
+ || n->sym->attr.omp_declare_target_local))
+ gfc_error ("%qs argument to MAP clause at %L must not be a "
+ "device-local variable, including GROUPPRIVATE",
+ n->sym->name, &n->where);
if (openacc
&& list == OMP_LIST_MAP
&& (n->u.map.op == OMP_MAP_ATTACH
--- /dev/null
+module m
+implicit none
+integer :: x
+!$omp declare target local(x)
+contains
+subroutine f
+integer, save :: y
+integer :: z
+common /com/ z
+
+! A variable that is a groupprivate variable or a device-local variable must
+! not appear as a list item in a map clause.
+
+!$omp groupprivate(y)
+!$omp groupprivate(/com/)
+!$omp target enter data map(x) ! { dg-error "'x' argument to MAP clause at .1. must not be a device-local variable, including GROUPPRIVATE" }
+!$omp target enter data map(y) ! { dg-error "'y' argument to MAP clause at .1. must not be a device-local variable, including GROUPPRIVATE" }
+!!$omp target enter data map(to : /com/) ! -> PR fortran/92730
+end
+
+end module