https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65397
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> --- The problem is in resolve_ordinary_assign (resolve.c): 9428 /* Assign the 'data' of a class object to a derived type. */ 9429 if (lhs->ts.type == BT_DERIVED 9430 && rhs->ts.type == BT_CLASS) 9431 gfc_add_data_component (rhs); But the RHS is: (gdb) p rhs->expr_type $2 = EXPR_FUNCTION (gdb) p rhs->symtree->name $3 = 0x7ffff1f45f90 "_F.caf_get" And adding "._data" fails in class.c as: 211 gfc_symbol *derived = e->symtree->n.sym->ts.u.derived; (gdb) p e->symtree->n.sym->ts.u.derived $4 = (gfc_symbol *) 0x0