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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index d9b9a9c..832eb64 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2691,6 +2691,14 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
if (same_type_check (to, 1, from, 0) == FAILURE)
return FAILURE;
+ if (to->ts.type != from->ts.type)
+ {
+ gfc_error ("The FROM and TO arguments in MOVE_ALLOC call at %L must be "
+ "either both polymorphic or both nonpolymorphic",
+ &from->where);
+ return FAILURE;
+ }
+
if (to->rank != from->rank)
{
gfc_error ("the '%s' and '%s' arguments of '%s' intrinsic at %L must "