diff options
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index caa0b7f..22a5ddc 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -158,6 +158,7 @@ gfc_match_array_ref (gfc_array_ref *ar, gfc_array_spec *as, int init, bool matched_bracket = false; gfc_expr *tmp; bool stat_just_seen = false; + bool team_just_seen = false; memset (ar, '\0', sizeof (*ar)); @@ -235,8 +236,21 @@ coarray: if (m == MATCH_ERROR) return MATCH_ERROR; + team_just_seen = false; stat_just_seen = false; - if (gfc_match(" , stat = %e",&tmp) == MATCH_YES && ar->stat == NULL) + if (gfc_match (" , team = %e", &tmp) == MATCH_YES && ar->team == NULL) + { + ar->team = tmp; + team_just_seen = true; + } + + if (ar->team && !team_just_seen) + { + gfc_error ("TEAM= attribute in %C misplaced"); + return MATCH_ERROR; + } + + if (gfc_match (" , stat = %e",&tmp) == MATCH_YES && ar->stat == NULL) { ar->stat = tmp; stat_just_seen = true; |