https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125610
--- Comment #3 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
trans-expr.cc:
13450
13451 if (gfc_option.rtcheck & GFC_RTCHECK_MEM && !init_flag
13452 && gfc_expr_attr (expr1).allocatable && expr1->rank &&
!expr2->rank)
13453 {
13454 tree cond;
13455 const char* msg;
(gdb) p *expr2
$19 = {expr_type = EXPR_FUNCTION, ts = {type = BT_CLASS, kind = 0, u = {
derived = 0x4d9a710, cl = 0x4d9a710, pad = 81372944}, interface = 0x0,
is_c_interop = 0, is_iso_c = 0, f90_type = BT_CLASS, deferred = false,
interop_kind = 0x0}, rank = 0, corank = 0, shape = 0x0, symtree =
0x4d98db0,
...
name = 0x7ffff7415670 "foo_factory_1_", base_object = 0x0, tbp =
0x4d98e70,
...
For reasons not clear to me the rank seems to be 0 for CLASS.
It is 1 if foo_factory_1_ is declared with TYPE.
A resolution issue?