From 272001a2444baade28fd272fd88a45dbe8ddeff6 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 25 Jun 2010 21:02:47 +0200 Subject: decl.c (gfc_match_entry): Allow END besides END SUBROUTINE/END FUNCTION for contained procedures. 2010-06-25 Tobias Burnus * decl.c (gfc_match_entry): Allow END besides END SUBROUTINE/END FUNCTION for contained procedures. 2010-06-25 Tobias Burnus * gfortran.dg/end_subroutine_1.f90: New. * gfortran.dg/end_subroutine_2.f90: New. * gfortran.dg/interface_proc_end.f90: Update. From-SVN: r161406 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/decl.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b635aec..b3da9a3 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,10 @@ 2010-06-25 Tobias Burnus + * decl.c (gfc_match_entry): Allow END besides + END SUBROUTINE/END FUNCTION for contained procedures. + +2010-06-25 Tobias Burnus + * parse.c (next_free, next_fixed): Allow ";" as first character. 2010-06-24 Tobias Burnus diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index aa7a266..73bc81c 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -5642,7 +5642,14 @@ gfc_match_end (gfc_statement *st) if (gfc_match_eos () == MATCH_YES) { - if (!eos_ok) + if (!eos_ok && (*st == ST_END_SUBROUTINE || *st == ST_END_FUNCTION)) + { + if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: END statement " + "instead of %s statement at %L", + gfc_ascii_statement (*st), &old_loc) == FAILURE) + goto cleanup; + } + else if (!eos_ok) { /* We would have required END [something]. */ gfc_error ("%s statement expected at %L", -- cgit v1.1