From e49f4c1fa1154acb8f4366a0f0e6142d9bd38a77 Mon Sep 17 00:00:00 2001 From: burnus Date: Mon, 4 Dec 2006 11:16:12 +0000 Subject: fortran/ 2006-12-04 Paul Thomas PR fortran/29916 * resolve.c (resolve_symbol): Allow host-associated variables in the specification expression of an array-valued function. * expr.c (check_restricted): Accept host-associated dummy array indices. testsuite/ 2006-12-04 Paul Thomas PR fortran/29916 * gfortran.dg/host_dummy_index_1.f90: Added additional test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119489 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/expr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/expr.c') diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 304d7c1f00d..16e89f85c26 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2047,14 +2047,15 @@ check_restricted (gfc_expr * e) /* gfc_is_formal_arg broadcasts that a formal argument list is being processed in resolve.c(resolve_formal_arglist). This is done so that host associated - dummy array indices are accepted (PR23446). */ + dummy array indices are accepted (PR23446). This mechanism also does the + same for the specification expressions of array-valued functions. */ if (sym->attr.in_common || sym->attr.use_assoc || sym->attr.dummy || sym->ns != gfc_current_ns || (sym->ns->proc_name != NULL && sym->ns->proc_name->attr.flavor == FL_MODULE) - || gfc_is_formal_arg ()) + || (gfc_is_formal_arg () && (sym->ns == gfc_current_ns))) { t = SUCCESS; break; -- cgit v1.2.3