https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84622
--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
This is the required fix:
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index d479b6a80e5..33c34ae5036 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -19159,7 +19159,7 @@ skip_interfaces:
if ((((sym->ts.type == BT_DERIVED && sym->ts.u.derived->attr.coarray_comp)
|| (sym->ts.type == BT_CLASS && sym->attr.class_ok
&& sym->ts.u.derived && CLASS_DATA (sym)
- && CLASS_DATA (sym)->attr.coarray_comp))
+ && CLASS_DATA (sym)->ts.u.derived->attr.coarray_comp))
|| (class_attr.codimension && class_attr.allocatable))
&& sym->attr.dummy && sym->attr.intent == INTENT_OUT)
{
It is the declared derived type that must not have coarray components :-)
I'll push this later on today as obvious.
Paul