https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69524
--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> --- Author: pault Date: Sat Mar 12 13:59:10 2016 New Revision: 234161 URL: https://gcc.gnu.org/viewcvs?rev=234161&root=gcc&view=rev Log: 2016-03-12 Paul Thomas <pa...@gcc.gnu.org> PR fortran/70031 * decl.c (gfc_match_prefix): Treat the 'module' prefix in the same way as the others, rather than fixing it to come last. (gfc_match_function_decl, gfc_match_subroutine): After errors in 'copy_prefix', emit them immediately in the case of module procedures to prevent a later ICE. PR fortran/69524 * decl.c (gfc_match_submod_proc): Permit 'module procedure' declarations within the contains section of modules as well as submodules. * resolve.c (resolve_fl_procedure): Likewise. *trans-decl.c (build_function_decl): Change the gcc_assert to allow all forms of module procedure declarations within module contains sections. 2016-03-12 Paul Thomas <pa...@gcc.gnu.org> PR fortran/70031 * gfortran.dg/submodule_14.f08: New test PR fortran/69524 * gfortran.dg/submodule_15.f08: New test Added: trunk/gcc/testsuite/gfortran.dg/submodule_14.f08 trunk/gcc/testsuite/gfortran.dg/submodule_15.f08 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/fortran/resolve.c trunk/gcc/fortran/trans-decl.c trunk/gcc/testsuite/ChangeLog