diff options
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index b665c354503..fd365eb136a 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -5732,9 +5732,10 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn) gfc_error ("Illegal stat-variable at %L for a PURE procedure", &stat->where); - if (stat->ts.type != BT_INTEGER - && !(stat->ref && (stat->ref->type == REF_ARRAY - || stat->ref->type == REF_COMPONENT))) + if ((stat->ts.type != BT_INTEGER + && !(stat->ref && (stat->ref->type == REF_ARRAY + || stat->ref->type == REF_COMPONENT))) + || stat->rank > 0) gfc_error ("Stat-variable at %L must be a scalar INTEGER " "variable", &stat->where); @@ -5759,10 +5760,11 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn) gfc_error ("Illegal errmsg-variable at %L for a PURE procedure", &errmsg->where); - if (errmsg->ts.type != BT_CHARACTER - && !(errmsg->ref - && (errmsg->ref->type == REF_ARRAY - || errmsg->ref->type == REF_COMPONENT))) + if ((errmsg->ts.type != BT_CHARACTER + && !(errmsg->ref + && (errmsg->ref->type == REF_ARRAY + || errmsg->ref->type == REF_COMPONENT))) + || errmsg->rank > 0 ) gfc_error ("Errmsg-variable at %L must be a scalar CHARACTER " "variable", &errmsg->where); |