aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 52bc5af..617fb35 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -6088,6 +6088,19 @@ match_case_selector (gfc_case **cp)
}
}
+ if (c->low && c->low->rank != 0)
+ {
+ gfc_error ("Expression in CASE selector at %L must be scalar",
+ &c->low->where);
+ goto cleanup;
+ }
+ if (c->high && c->high->rank != 0)
+ {
+ gfc_error ("Expression in CASE selector at %L must be scalar",
+ &c->high->where);
+ goto cleanup;
+ }
+
*cp = c;
return MATCH_YES;