* resolve.c (resolve_actual_arglist): Issue an error if a statement
functions is used as actual argument.
* gfortran.dg/pr20865.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98919
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-04-28 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR fortran/20865
+ * resolve.c (resolve_actual_arglist): Issue an error if a statement
+ functions is used as actual argument.
+
2005-04-27 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/21177
|| 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. */
+2005-04-28 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR fortran/20865
+ * gfortran.dg/pr20865.f90: New test.
+
2005-04-28 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/void-cast-2.c: New test.
--- /dev/null
+! { dg-do compile }
+! PR fortran/20865
+ subroutine tt(j)
+ integer :: j
+ end subroutine
+
+ integer :: i, st
+ st(i) = (i*i+2)
+ call tt(st) ! { dg-error "Statement function .* is not allowed as an actual argument" }
+ end