aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobi@gcc.gnu.org>2007-04-12 20:07:09 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2007-04-12 20:07:09 +0200
commit690af37922ff3399d545d03196867ad1424c14aa (patch)
treecd6e32a845d732e339b5c424410684c412ab5248 /gcc/fortran/match.c
parent8cb6400cdaea428d965f6a22b39e4b7d2acff880 (diff)
downloadgcc-690af37922ff3399d545d03196867ad1424c14aa.zip
gcc-690af37922ff3399d545d03196867ad1424c14aa.tar.gz
gcc-690af37922ff3399d545d03196867ad1424c14aa.tar.bz2
decl.c (gfc_match_end): Also check for construct name in END FORALL and END WERE statements.
fortran/31471 fortran/ * decl.c (gfc_match_end): Also check for construct name in END FORALL and END WERE statements. * match.c (match_case_eos): Use uppercase for statement name in error message. (match_elsewhere): Construct name may appear iff construct has a name. testsuite/ * gfortran.dg/block_name_1.f90: New. * gfortran.dg/block_name_2.f90: New. From-SVN: r123758
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index dc76911..2483ea3 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -3053,7 +3053,7 @@ match_case_eos (void)
should have matched the EOS. */
if (!gfc_current_block ())
{
- gfc_error ("Expected the name of the select case construct at %C");
+ gfc_error ("Expected the name of the SELECT CASE construct at %C");
return MATCH_ERROR;
}
@@ -3299,7 +3299,14 @@ gfc_match_elsewhere (void)
}
if (gfc_match_eos () != MATCH_YES)
- { /* Better be a name at this point */
+ {
+ /* Only makes sense if we have a where-construct-name. */
+ if (!gfc_current_block ())
+ {
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+ /* Better be a name at this point */
m = gfc_match_name (name);
if (m == MATCH_NO)
goto syntax;