From 781e1004f3eee23f946442b7829118a11212898c Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Thu, 28 Apr 2005 13:56:08 +0200 Subject: re PR fortran/20865 (statement function shall not be supplied as procedure argument) PR fortran/20865 * resolve.c (resolve_actual_arglist): Issue an error if a statement functions is used as actual argument. * gfortran.dg/pr20865.f90: New test. From-SVN: r98919 --- gcc/fortran/resolve.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index d75704b..a4667b7 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -604,6 +604,12 @@ resolve_actual_arglist (gfc_actual_arglist * arg) || sym->attr.external) { + if (sym->attr.proc == PROC_ST_FUNCTION) + { + gfc_error ("Statement function '%s' at %L is not allowed as an " + "actual argument", sym->name, &e->where); + } + /* If the symbol is the function that names the current (or parent) scope, then we really have a variable reference. */ -- cgit v1.1