Hello, I'm going to commit the following (to trunk and 4.6) once the regression test finishes.
Mikael
2011-08-19 Mikael Morin <mikael.mo...@sfr.fr> PR fortran/50129 * parse.c (parse_where): Undo changes after emitting an error. 2011-08-19 Mikael Morin <mikael.mo...@sfr.fr> PR fortran/50129 * where_3.f90: New test.
diff --git a/parse.c b/parse.c index aab711c..9b11086 100644 --- a/parse.c +++ b/parse.c @@ -2778,6 +2778,7 @@ parse_where_block (void) { gfc_error ("ELSEWHERE statement at %C follows previous " "unmasked ELSEWHERE"); + reject_statement (); break; }
! { dg-do compile } ! ! PR fortran/50129 ! ICE after reporting an error on a masked ELSEWHERE statement following an ! unmasked one. ! ! Contributed by Joost Van de Vondele <joost.vandevond...@pci.uzh.ch> INTEGER :: I(3) WHERE (I>2) ELSEWHERE ELSEWHERE (I<1) ! { dg-error "follows previous unmasked ELSEWHERE" } END WHERE END