summaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-13 21:11:42 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-13 21:11:42 +0000
commitc286c29493938ae70e8833667e48cf228c193990 (patch)
tree7f2c561457336fc4f7da2aca28df95d5c98a0c45 /gcc/fortran/match.c
parent93959c9106bd4d0ee64ac58b121f78b0597aa2c7 (diff)
downloadgcc-c286c29493938ae70e8833667e48cf228c193990.tar.gz
2015-11-13 Steven G. Kargl <kargl@gccc.gnu.org>
PR fortran/68319 * decl.c (gfc_match_data, gfc_match_entry): Enforce F2008:C1206. * io.c (gfc_match_format): Ditto. * match.c (gfc_match_st_function): Ditto. 2015-11-13 Steven G. Kargl <kargl@gccc.gnu.org> PR fortran/68319 * gfortran.dg/pr68319.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230351 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index d4ba350ab59..22b0d7d42f7 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -4913,6 +4913,15 @@ gfc_match_st_function (void)
sym->value = expr;
+ if ((gfc_current_state () == COMP_FUNCTION
+ || gfc_current_state () == COMP_SUBROUTINE)
+ && gfc_state_stack->previous->state == COMP_INTERFACE)
+ {
+ gfc_error ("Statement function at %L cannot appear within an INTERFACE",
+ &expr->where);
+ return MATCH_ERROR;
+ }
+
if (!gfc_notify_std (GFC_STD_F95_OBS, "Statement function at %C"))
return MATCH_ERROR;