diff options
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 60adde3..28b8ea1 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -741,6 +741,13 @@ gfc_match_submodule (void) if (!gfc_notify_std (GFC_STD_F2008, "SUBMODULE declaration at %C")) return MATCH_ERROR; + if (gfc_current_state () != COMP_NONE) + { + gfc_error ("SUBMODULE declaration at %C cannot appear within " + "another scoping unit"); + return MATCH_ERROR; + } + gfc_new_block = NULL; gcc_assert (module_list == NULL); |