aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-10-21 20:50:52 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-10-21 20:50:52 +0200
commitbf9d2177bff84eab383fa36cdee01e122884d5da (patch)
treedf26fd7465b4b82175c76b362d35b133f23ff38b /gcc/fortran/interface.c
parent2c47f8751a5bea5692b8b68e4c89f7ef6c132e41 (diff)
downloadgcc-bf9d2177bff84eab383fa36cdee01e122884d5da.zip
gcc-bf9d2177bff84eab383fa36cdee01e122884d5da.tar.gz
gcc-bf9d2177bff84eab383fa36cdee01e122884d5da.tar.bz2
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
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c15
1 files changed, 15 insertions, 0 deletions
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)
{