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
This commit is contained in:
Nicolas Koenig 2017-04-10 22:58:21 +02:00 committed by Nicolas Koenig
parent b447b28c5e
commit a2cb1196cf
5 changed files with 30 additions and 1 deletions

View File

@ -1,3 +1,11 @@
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 Janus Weil <janus@gcc.gnu.org>
PR fortran/80046

View File

@ -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);

View File

@ -1,3 +1,10 @@
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
2017-04-10 Jakub Jelinek <jakub@redhat.com>
PR c++/80176

View File

@ -0,0 +1,7 @@
! { dg-do compile }
! PR fortran/69498
! This used to ICE
program main
submodule (m) sm ! { dg-error "SUBMODULE declaration at" }
submodule (m2) sm2 ! { dg-error "SUBMODULE declaration at" }
end program

View File

@ -3,6 +3,6 @@
! This used to ICE
program p
type t
submodule (m) sm ! { dg-error "Unexpected SUBMODULE statement at" }
submodule (m) sm ! { dg-error "SUBMODULE declaration at" }
end type
end