re PR fortran/66040 (ICE on misplaced sequence in function)

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/66040
	* parse.c(verify_st_order): Replace a gfc_internal_error with your
	generic gfc_error.

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/66040
	* gfortran.dg/misplaced_statement.f90: New test.

From-SVN: r223318
This commit is contained in:
Steven G. Kargl 2015-05-18 21:16:05 +00:00
parent 589ff4d209
commit 46b6b3542d
4 changed files with 32 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66040
* parse.c(verify_st_order): Replace a gfc_internal_error with your
generic gfc_error.
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66039

View File

@ -2425,8 +2425,7 @@ verify_st_order (st_state *p, gfc_statement st, bool silent)
break;
default:
gfc_internal_error ("Unexpected %s statement in verify_st_order() at %C",
gfc_ascii_statement (st));
return false;
}
/* All is well, record the statement in case we need it next time. */

View File

@ -1,3 +1,8 @@
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66040
* gfortran.dg/misplaced_statement.f90: New test.
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66039

View File

@ -0,0 +1,20 @@
!{ dg-do compile }
! PR fortran/66040
!
! Original code from Gerhard Steinmetz
! <gerhard dot steinmetz dot fortran at t-online dot de>
real function f1(x)
sequence ! { dg-error "Unexpected SEQUENCE statement" }
end function f1
real function f2()
else ! { dg-error "Unexpected ELSE statement" }
end function f2
real function f3()
block data ! { dg-error "Unexpected BLOCK DATA statement" }
end function f3
real function f4()
program p ! { dg-error "Unexpected PROGRAM statement" }
end function f4