Commit 46b6b354 by Steven G. Kargl

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
parent 589ff4d2
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
* io.c (match_filepos): Check for incomplete/mangled REWIND, FLUSH,
BACKSPACE, and ENDFILE statements
......
......@@ -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. */
......
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
* gfortran.dg/filepos1.f90: New test
......
!{ 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment