diff options
Diffstat (limited to 'gcc/fortran/match.c')
| -rw-r--r-- | gcc/fortran/match.c | 11 |
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; |
