diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2004-06-15 23:50:50 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2004-06-15 23:50:50 +0200 |
commit | 6ef4215401ab8001886973790886dfd75446c037 (patch) | |
tree | 91cec34fb614da23cba18dd77a187546799cb659 /gcc/fortran | |
parent | 0173bb6f2d715c4c3839c17e26a38bd522e07fa4 (diff) | |
download | gcc-6ef4215401ab8001886973790886dfd75446c037.zip gcc-6ef4215401ab8001886973790886dfd75446c037.tar.gz gcc-6ef4215401ab8001886973790886dfd75446c037.tar.bz2 |
re PR fortran/15962 (constant expression not recognized as such)
fortran/
PR fortran/15962
* match.c (match_case_selector): Call gfc_match_init_expr
instead of gfc_match_expr.
* resolve.c (validate_case_label_expr): No need to check for
constant, since it wouldn't have been matched with the fix to
match.c.
testsuite/
PR fortran/15962
* gfortran.fortran-torture/execute/select_1.f90: New test.
From-SVN: r83202
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/fortran/match.c | 8 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 7 |
3 files changed, 13 insertions, 11 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 57a9164..ef5d72b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2004-06-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> + + PR fortran/15962 + * match.c (match_case_selector): Call gfc_match_init_expr + instead of gfc_match_expr. + * resolve.c (validate_case_label_expr): No need to check for + constant, since it wouldn't have been matched with the fix to + match.c. + 2004-06-14 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/15211 diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 79a7e4c..bc2379d 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -3102,7 +3102,7 @@ match_case_selector (gfc_case ** cp) if (gfc_match_char (':') == MATCH_YES) { - m = gfc_match_expr (&c->high); + m = gfc_match_init_expr (&c->high); if (m == MATCH_NO) goto need_expr; if (m == MATCH_ERROR) @@ -3111,7 +3111,7 @@ match_case_selector (gfc_case ** cp) else { - m = gfc_match_expr (&c->low); + m = gfc_match_init_expr (&c->low); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_NO) @@ -3123,7 +3123,7 @@ match_case_selector (gfc_case ** cp) c->high = c->low; else { - m = gfc_match_expr (&c->high); + m = gfc_match_init_expr (&c->high); if (m == MATCH_ERROR) goto cleanup; /* MATCH_NO is fine. It's OK if nothing is there! */ @@ -3134,7 +3134,7 @@ match_case_selector (gfc_case ** cp) return MATCH_YES; need_expr: - gfc_error ("Expected expression in CASE at %C"); + gfc_error ("Expected initialization expression in CASE at %C"); cleanup: free_case (c); diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index d33dcb2..b19721f 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -2586,13 +2586,6 @@ validate_case_label_expr (gfc_expr * e, gfc_expr * case_expr) if (e == NULL) return SUCCESS; - if (e->expr_type != EXPR_CONSTANT) - { - gfc_error ("Expression in CASE statement at %L must be a constant", - &e->where); - return FAILURE; - } - if (e->ts.type != case_ts.type) { gfc_error ("Expression in CASE statement at %L must be of type %s", |