aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorNicolas Koenig <koenigni@student.ethz.ch>2017-04-10 22:58:21 +0200
committerNicolas Koenig <koenigni@gcc.gnu.org>2017-04-10 20:58:21 +0000
commita2cb1196cf9a8e46e0bbaa2998b98ecbc8ecd595 (patch)
treeb37c089fe660171581ae1e8c7c6220ba7b269715 /gcc/fortran/module.c
parentb447b28c5e434eb949e30985a7c2d49f6aa592fe (diff)
downloadgcc-a2cb1196cf9a8e46e0bbaa2998b98ecbc8ecd595.zip
gcc-a2cb1196cf9a8e46e0bbaa2998b98ecbc8ecd595.tar.gz
gcc-a2cb1196cf9a8e46e0bbaa2998b98ecbc8ecd595.tar.bz2
re PR fortran/69498 (ICE on disjunct cases with displaced or incomplete embedded statement)
2017-04-10 Nicolas Koenig <koenigni@student.ethz.ch> Paul Thomas <pault@gcc.gnu.org> PR fortran/69498 * module.c (gfc_match_submodule): Add error if function is called in the wrong state. 2017-04-10 Nicolas Koenig <koenigni@student.ethz.ch> PR fortran/69498 * gfortran.dg/submodule_unexp.f90: Modified test to account for new error. * gfortran.dg/submodule_twice.f90: New Test Co-Authored-By: Paul Thomas <pault@gcc.gnu.org> From-SVN: r246826
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c7
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);