2018-02-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/35299
* gfortran.dg/statement_function_3.f: New test.
2018-02-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/35299
* resolve.c (resolve_formal_arglist): Update error message.
From-SVN: r257566
{
if (sym->as != NULL)
{
- gfc_error ("Argument %qs of statement function at %L must "
- "be scalar", sym->name, &sym->declared_at);
+ /* F03:C1263 (R1238) The function-name and each dummy-arg-name
+ shall be specified, explicitly or implicitly, to be scalar. */
+ gfc_error ("Argument '%s' of statement function '%s' at %L "
+ "must be scalar", sym->name, proc->name,
+ &proc->declared_at);
continue;
}
--- /dev/null
+! { dg-do compile }
+! PR fortran/35299
+ subroutine phtod(e,n,i,h)
+ dimension e(n)
+ hstar(e,b)=b**.4*((1.25*fun(-e/40)+.18)) ! { dg-error "must be scalar" }
+ a = 1.
+ h = hstar(e(i-1), a)
+ end
+
+ function fun(a)
+ real a(*)
+ fun = 42
+ end
+! { dg-prune-output " Obsolescent feature" }
+