https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104131
--- Comment #5 from anlauf at gcc dot gnu.org --- The coarray cases in comment#2 will be rejected with: diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index 1cc65d7fa49..08081dacde4 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -8967,6 +8967,9 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, else if (omp_clauses->detach->symtree->n.sym->attr.dimension > 0) gfc_error ("The event handle at %L must not be an array element", &omp_clauses->detach->where); + else if (omp_clauses->detach->symtree->n.sym->attr.codimension) + gfc_error ("The event handle at %L must not be a coarray", + &omp_clauses->detach->where); else if (omp_clauses->detach->symtree->n.sym->ts.type == BT_DERIVED || omp_clauses->detach->symtree->n.sym->ts.type == BT_CLASS) gfc_error ("The event handle at %L must not be part of " I assume that these are not allowed.