aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2008-09-09 20:08:08 +0200
committerDaniel Kraft <domob@gcc.gnu.org>2008-09-09 20:08:08 +0200
commit00ca66405c3b9da27fab36bd55e62148e97d7491 (patch)
tree652b729072d1934ca2c55d2cf26b864558540c25 /gcc/fortran/resolve.c
parent5a3d7e74caea0e0ff01f12191aaf479a558fa192 (diff)
downloadgcc-00ca66405c3b9da27fab36bd55e62148e97d7491.zip
gcc-00ca66405c3b9da27fab36bd55e62148e97d7491.tar.gz
gcc-00ca66405c3b9da27fab36bd55e62148e97d7491.tar.bz2
re PR fortran/37429 (Checks when assigning from a type-bound procedure broken)
2008-09-09 Daniel Kraft <d@domob.eu> PR fortran/37429 * resolve.c (expression_rank): Added assertion to guard against EXPR_COMPCALL expressions. (resolve_compcall): Set expression's rank from the target procedure's. 2008-09-09 Daniel Kraft <d@domob.eu> PR fortran/37429 * gfortran.dg/typebound_call_7.f03: New test. * gfortran.dg/typebound_call_8.f03: New test. From-SVN: r140163
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 05f2c14..69245f2 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -4021,6 +4021,10 @@ expression_rank (gfc_expr *e)
gfc_ref *ref;
int i, rank;
+ /* Just to make sure, because EXPR_COMPCALL's also have an e->ref and that
+ could lead to serious confusion... */
+ gcc_assert (e->expr_type != EXPR_COMPCALL);
+
if (e->ref == NULL)
{
if (e->expr_type == EXPR_ARRAY)
@@ -4550,6 +4554,11 @@ resolve_compcall (gfc_expr* e)
if (resolve_typebound_generic_call (e) == FAILURE)
return FAILURE;
+ gcc_assert (!e->value.compcall.tbp->is_generic);
+
+ /* Take the rank from the function's symbol. */
+ if (e->value.compcall.tbp->u.specific->n.sym->as)
+ e->rank = e->value.compcall.tbp->u.specific->n.sym->as->rank;
/* For now, we simply transform it into an EXPR_FUNCTION call with the same
arglist to the TBP's binding target. */