summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/resolve.c7
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/statement_function_3.f15
4 files changed, 32 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8d0e84a0535..66ebb310265 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2018-02-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/35299
+ ChangeLog for r257566
+ * resolve.c (resolve_formal_arglist): Update error message.
+
2018-02-12 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/54223
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index ef938009f75..84600bd959c 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -506,8 +506,11 @@ resolve_formal_arglist (gfc_symbol *proc)
{
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;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c07d8797dac..cb53750fd61 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2018-02-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/35299
+ ChangeLog for r257566
+ * gfortran.dg/statement_function_3.f: New test.
+
2018-02-12 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/54223
diff --git a/gcc/testsuite/gfortran.dg/statement_function_3.f b/gcc/testsuite/gfortran.dg/statement_function_3.f
new file mode 100644
index 00000000000..dcfb3e2b9dc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/statement_function_3.f
@@ -0,0 +1,15 @@
+! { 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" }
+