diff options
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c392d9d..d2a301d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2009-09-07 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/41197 + * resolve_c (resolve_allocate_deallocate): Complain + if stat or errmsg varaible is an array. + 2009-09-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/41258 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index b665c35..fd365eb 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); |