aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 793ad75..0923f12 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2791,18 +2791,15 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
return FAILURE;
}
- if (to->ts.kind != from->ts.kind)
+ /* CLASS arguments: Make sure the vtab of from is present. */
+ if (to->ts.type == BT_CLASS && !UNLIMITED_POLY (from))
{
- gfc_error ("The FROM and TO arguments of the MOVE_ALLOC intrinsic at %L"
- " must be of the same kind %d/%d", &to->where, from->ts.kind,
- to->ts.kind);
- return FAILURE;
+ if (from->ts.type == BT_CLASS || from->ts.type == BT_DERIVED)
+ gfc_find_derived_vtab (from->ts.u.derived);
+ else
+ gfc_find_intrinsic_vtab (&from->ts);
}
- /* CLASS arguments: Make sure the vtab of from is present. */
- if (to->ts.type == BT_CLASS)
- gfc_find_derived_vtab (from->ts.u.derived);
-
return SUCCESS;
}