diff options
author | Tobias Schlüter <tobi@gcc.gnu.org> | 2007-04-12 20:07:09 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2007-04-12 20:07:09 +0200 |
commit | 690af37922ff3399d545d03196867ad1424c14aa (patch) | |
tree | cd6e32a845d732e339b5c424410684c412ab5248 /gcc/fortran | |
parent | 8cb6400cdaea428d965f6a22b39e4b7d2acff880 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 3 | ||||
-rw-r--r-- | gcc/fortran/match.c | 11 |
3 files changed, 19 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 58b790b..e99ccd1 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,13 @@ 2007-04-12 Tobias Schlüter <tobi@gcc.gnu.org> + PR fortran/31471 + * 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. + * trans-types.c: Update copyright years. Reformat long comment explaining array descriptor format. Remove obsolete mention of TYPE_SET. diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 67d05b8..43e0235 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -3340,7 +3340,8 @@ gfc_match_end (gfc_statement *st) if (gfc_match_eos () == MATCH_YES) { - if (*st != ST_ENDDO && *st != ST_ENDIF && *st != ST_END_SELECT) + if (*st != ST_ENDDO && *st != ST_ENDIF && *st != ST_END_SELECT + && *st != ST_END_FORALL && *st != ST_END_WHERE) return MATCH_YES; if (gfc_current_block () == NULL) 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; |