From 14f10e09117672cbded9e0cfd2596d0f03b10f27 Mon Sep 17 00:00:00 2001 From: janus Date: Thu, 15 Feb 2018 21:16:00 +0000 Subject: 2018-02-15 Janus Weil PR fortran/84409 * interface.c (check_dtio_arg_TKR_intent): Add a check for character length. 2018-02-15 Janus Weil PR fortran/84409 * gfortran.dg/dtio_21.f03: Add an error message. * gfortran.dg/dtio_22.f90: Fix invalid test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257711 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/interface.c') diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index a5f3f4dda16..ad029289c0f 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -4673,7 +4673,7 @@ gfc_check_typebound_override (gfc_symtree* proc, gfc_symtree* old) /* The following three functions check that the formal arguments of user defined derived type IO procedures are compliant with - the requirements of the standard. */ + the requirements of the standard, see F03:9.5.3.7.2 (F08:9.6.4.8.3). */ static void check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool typebound, bt type, @@ -4702,6 +4702,10 @@ check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool typebound, bt type, gfc_error ("DTIO dummy argument at %L must be an " "ASSUMED SHAPE ARRAY", &fsym->declared_at); + if (type == BT_CHARACTER && fsym->ts.u.cl->length != NULL) + gfc_error ("DTIO character argument at %L must have assumed length", + &fsym->declared_at); + if (fsym->attr.intent != intent) gfc_error ("DTIO dummy argument at %L must have INTENT %s", &fsym->declared_at, gfc_code2string (intents, (int)intent)); -- cgit v1.2.1 From 3d7540918d8a8915b481a8c0faebc2aeb92ad6ca Mon Sep 17 00:00:00 2001 From: kargl Date: Fri, 23 Feb 2018 18:57:41 +0000 Subject: 2018-02-23 Steven G. Kargl PR fortran/84346 * interface.c (compare_actual_formal): Issue error if keyword is used in a statement function. 2018-02-23 Steven G. Kargl PR fortran/84346 * gfortran.dg/statement_function_1.f90: Update test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257942 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/interface.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/fortran/interface.c') diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index ad029289c0f..cb326e55c75 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -2865,6 +2865,13 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, for (a = actual; a; a = a->next, f = f->next) { + if (a->name != NULL && in_statement_function) + { + gfc_error ("Keyword argument %qs at %L is invalid in " + "a statement function", a->name, &a->expr->where); + return false; + } + /* Look for keywords but ignore g77 extensions like %VAL. */ if (a->name != NULL && a->name[0] != '%') { -- cgit v1.2.1