From bf9d2177bff84eab383fa36cdee01e122884d5da Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 21 Oct 2005 20:50:52 +0200 Subject: interface.c (compare_actual_formal): Issue error when attempting to pass an assumed-size array as assumed-shape... * interface.c (compare_actual_formal): Issue error when attempting to pass an assumed-size array as assumed-shape array argument. * gfortran.dg/assumed_dummy_2.f90: New test. From-SVN: r105765 --- gcc/fortran/interface.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gcc/fortran/interface.c') diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 9edbb15..5314d87 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1235,6 +1235,21 @@ compare_actual_formal (gfc_actual_arglist ** ap, return 0; } + if (f->sym->as + && f->sym->as->type == AS_ASSUMED_SHAPE + && a->expr->expr_type == EXPR_VARIABLE + && a->expr->symtree->n.sym->as + && a->expr->symtree->n.sym->as->type == AS_ASSUMED_SIZE + && (a->expr->ref == NULL + || (a->expr->ref->type == REF_ARRAY + && a->expr->ref->u.ar.type == AR_FULL))) + { + if (where) + gfc_error ("Actual argument for '%s' cannot be an assumed-size" + " array at %L", f->sym->name, where); + return 0; + } + if (a->expr->expr_type != EXPR_NULL && compare_pointer (f->sym, a->expr) == 0) { -- cgit v1.1