diff options
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |