diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-12-28 12:22:14 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-12-28 12:22:14 +0100 |
commit | f968d60be0ef5ee2ebcf06f673f33d469602188c (patch) | |
tree | 12254814161ab792663751f405fa5cca5c701f75 /gcc/fortran/check.c | |
parent | 70225583efac5b66080e2699956623c146465955 (diff) | |
download | gcc-f968d60be0ef5ee2ebcf06f673f33d469602188c.zip gcc-f968d60be0ef5ee2ebcf06f673f33d469602188c.tar.gz gcc-f968d60be0ef5ee2ebcf06f673f33d469602188c.tar.bz2 |
re PR fortran/55763 (Issues with some simpler CLASS(*) programs)
2012-12-28 Tobias Burnus <burnus@net-b.de>
PR fortran/55763
* check.c (gfc_check_move_alloc): Handle unlimited polymorphic.
* trans-intrinsic.c (conv_intrinsic_move_alloc): Ditto.
2012-12-28 Tobias Burnus <burnus@net-b.de>
PR fortran/55763
* gfortran.dg/unlimited_polymorphic_5.f90
From-SVN: r194743
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r-- | gcc/fortran/check.c | 15 |
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; } |