diff options
author | Nicolas Koenig <koenigni@student.ethz.ch> | 2017-04-10 22:58:21 +0200 |
---|---|---|
committer | Nicolas Koenig <koenigni@gcc.gnu.org> | 2017-04-10 20:58:21 +0000 |
commit | a2cb1196cf9a8e46e0bbaa2998b98ecbc8ecd595 (patch) | |
tree | b37c089fe660171581ae1e8c7c6220ba7b269715 /gcc/fortran/module.c | |
parent | b447b28c5e434eb949e30985a7c2d49f6aa592fe (diff) | |
download | gcc-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.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); |