2008-01-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34763
* decl.c (contained_procedure): Only check directly preceeding
* state.
2008-01-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34763
* gfortran.dg/interface_proc_end.f90: New.
From-SVN: r131512
+2008-01-13 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34763
+ * decl.c (contained_procedure): Only check directly preceeding state.
+
2008-01-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34759
static int
contained_procedure (void)
{
- gfc_state_data *s;
+ gfc_state_data *s = gfc_state_stack;
- for (s=gfc_state_stack; s; s=s->previous)
- if ((s->state == COMP_SUBROUTINE || s->state == COMP_FUNCTION)
- && s->previous != NULL && s->previous->state == COMP_CONTAINS)
- return 1;
+ if ((s->state == COMP_SUBROUTINE || s->state == COMP_FUNCTION)
+ && s->previous != NULL && s->previous->state == COMP_CONTAINS)
+ return 1;
return 0;
}
+2008-01-13 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34763
+ * gfortran.dg/interface_proc_end.f90: New.
+
2008-01-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34759
--- /dev/null
+! { dg-do compile}
+!
+! PR fortran/34763
+! Before, gfortran did not allow for the "END" in
+! the interface, which is no module procedure.
+!
+! Test case contributed by Dick Hendrickson
+!
+ module n
+ contains
+ subroutine n_interface
+ INTERFACE
+ SUBROUTINE NGSXDY(TLS1,TLS2)
+ REAL :: TLS1,TLS2
+ END ! OK
+ END INTERFACE
+ end ! { dg-error "END SUBROUTINE statement" }
+ end module ! { dg-error "END SUBROUTINE statement" }
+! { dg-excess-errors "Unexpected end of file" }