&& n->sym->as->type == AS_ASSUMED_SIZE)
gfc_error ("Assumed size array %qs in %s clause at %L",
n->sym->name, name, &n->where);
+ if (!openacc
+ && list == OMP_LIST_MAP
+ && n->sym->ts.type == BT_DERIVED
+ && n->sym->ts.u.derived->attr.alloc_comp)
+ gfc_error ("List item %qs with allocatable components is not "
+ "permitted in map clause at %L", n->sym->name,
+ &n->where);
if (list == OMP_LIST_MAP && !openacc)
switch (code->op)
{
--- /dev/null
+!
+! ALLOCATABLE COMPONENTS:
+! - OpenMP 5: Permitted (and automatically recursively mapped)
+! -> Not yet supported.
+! - OpenMP 4.5: Not permitted.
+!
+implicit none (type, external)
+type sct
+ integer, allocatable :: c
+end type
+type(sct) var
+
+!$omp target enter data map(to:var) ! { dg-error "allocatable components is not permitted in map clause" }
+end