summaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-23 22:36:54 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-23 22:36:54 +0000
commit88a3ea34080ad3087a8191fbf479543153175d59 (patch)
tree34eaec34d3588e09f9a77abba776266f124dc823 /gcc/fortran/interface.c
parent25e15aaed275cdfef34b3ee6eb3cb4b43a48d44f (diff)
parente65055a558093bd4fc0b1b0024b7814cc187b8e8 (diff)
downloadgcc-88a3ea34080ad3087a8191fbf479543153175d59.tar.gz
Merge from trunk revision 257954.gccgo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gccgo@257955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index a5f3f4dda16..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] != '%')
{
@@ -4673,7 +4680,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 +4709,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));