tree *chain = NULL;
bool got_canonical = false;
bool unlimited_entity = false;
- gfc_component *c;
+ gfc_component *c, *last_c = nullptr;
gfc_namespace *ns;
tree tmp;
bool coarray_flag, class_coarray_flag;
types. */
if (class_coarray_flag || !c->backend_decl)
c->backend_decl = field;
+ if (c->attr.caf_token && last_c)
+ last_c->caf_token = field;
if (c->attr.pointer && (c->attr.dimension || c->attr.codimension)
&& !(c->ts.type == BT_DERIVED && strcmp (c->name, "_data") == 0))
GFC_DECL_PTR_ARRAY_P (c->backend_decl) = 1;
+
+ last_c = c;
}
/* Now lay out the derived type, including the fields. */
--- /dev/null
+! { dg-do compile }
+
+! Check PR84244 does not ICE anymore.
+
+program ptr_comp_5
+ integer, target :: dest = 42
+ type t
+ integer, pointer :: p
+ end type
+ type(t) :: o[*]
+
+ o%p => dest
+contains
+ ! This unused routine is crucial for the ICE.
+ function f(x)
+ type(t), intent(in) ::x
+ end function
+end program
+