diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2019-04-22 06:50:33 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2019-04-22 06:50:33 +0000 |
commit | 16a51cf5491b642639b60ea12c0fff12a5403934 (patch) | |
tree | 3df2343a26f4954033b65ca19113ed070fefedfd /gcc/fortran/resolve.c | |
parent | 76a86e861665f8fc9595969112eb5a08590b5a29 (diff) | |
download | gcc-16a51cf5491b642639b60ea12c0fff12a5403934.zip gcc-16a51cf5491b642639b60ea12c0fff12a5403934.tar.gz gcc-16a51cf5491b642639b60ea12c0fff12a5403934.tar.bz2 |
re PR fortran/57284 ([OOP] ICE with find_array_spec for polymorphic arrays)
2019-04-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/57284
* resolve.c (find_array_spec): If this is a class expression
and the symbol and component array specs are the same, this is
not an error.
*trans-intrinsic.c (gfc_conv_intrinsic_size): If a class symbol
argument, has no namespace, it has come from the interface
mapping and the _data component must be accessed directly.
2019-04-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/57284
* gfortran.dg/class_70.f03
From-SVN: r270489
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index cb41da0..8232deb 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -4712,9 +4712,13 @@ find_array_spec (gfc_expr *e) gfc_array_spec *as; gfc_component *c; gfc_ref *ref; + bool class_as = false; if (e->symtree->n.sym->ts.type == BT_CLASS) - as = CLASS_DATA (e->symtree->n.sym)->as; + { + as = CLASS_DATA (e->symtree->n.sym)->as; + class_as = true; + } else as = e->symtree->n.sym->as; @@ -4733,7 +4737,7 @@ find_array_spec (gfc_expr *e) c = ref->u.c.component; if (c->attr.dimension) { - if (as != NULL) + if (as != NULL && !(class_as && as == c->as)) gfc_internal_error ("find_array_spec(): unused as(1)"); as = c->as; } |