diff options
author | Andre Vehreschild <vehre@gmx.de> | 2015-02-06 11:22:54 +0000 |
---|---|---|
committer | Andre Vehreschild <vehre@gmx.de> | 2015-02-06 11:22:54 +0000 |
commit | bf3880911ec596227880b0b68f53142f8a79c842 (patch) | |
tree | 5389ce292f0a5b165c64799355b8af0e1724dcb6 /gcc/fortran/resolve.c | |
parent | 5695c7e24ba6ccecacb62128e06572b48bf82690 (diff) |
PR fortran/60289
Initial patch by Janus Weil
* resolve.c (resolve_allocate_expr): Add check for comp. only when
target is not unlimited polymorphic.
* trans-stmt.c (gfc_trans_allocate): Assign correct value to _len
component of unlimited polymorphic entities.
* gfortran.dg/unlimited_polymorphic_22.f90: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@220474 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 0b188dad05b..b1111cc4cf5 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -6933,7 +6933,9 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code) goto failure; } - if (code->ext.alloc.ts.type == BT_CHARACTER && !e->ts.deferred) + /* Check F08:C632. */ + if (code->ext.alloc.ts.type == BT_CHARACTER && !e->ts.deferred + && !UNLIMITED_POLY (e)) { int cmp = gfc_dep_compare_expr (e->ts.u.cl->length, code->ext.alloc.ts.u.cl->length); |