From: Tobias Schlüter Date: Wed, 9 Jun 2004 12:35:39 +0000 (+0200) Subject: re PR fortran/13201 (PARAMETER variables of nonconstant shape are accepted) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4ac5dd3ef232d1b4b820960fef7f787525b8009;p=gcc.git re PR fortran/13201 (PARAMETER variables of nonconstant shape are accepted) PR fortran/13201 * resolve.c (resolve_symbol): Verify that parameter array has an explicit shape. Fix typos and coding style issues in surrounding lines. From-SVN: r82830 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 394ccc688c0..9034b9564c8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,11 @@ -2004-06-05 Tobias Schlueter +2004-06-09 Tobias Schlueter + + PR fortran/13201 + * resolve.c (resolve_symbol): Verify that parameter array has an + explicit shape. Fix typos and coding style issues in surrounding + lines. + +2004-06-05 Tobias Schlueter PR fortran/15478 * gfortran.texi: The documentation doesn't contain infomration on diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index ca9208f4caf..d33dcb21176 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -3736,14 +3736,22 @@ resolve_symbol (gfc_symbol * sym) || sym->as->type == AS_ASSUMED_SHAPE) && sym->attr.dummy == 0) { - gfc_error("Assumed %s array at %L must be a dummy argument", - sym->as->type == AS_ASSUMED_SIZE ? "size" : "shape", - &sym->declared_at); + gfc_error ("Assumed %s array at %L must be a dummy argument", + sym->as->type == AS_ASSUMED_SIZE ? "size" : "shape", + &sym->declared_at); + return; + } + + if (sym->attr.flavor == FL_PARAMETER + && sym->as != NULL && sym->as->type != AS_EXPLICIT) + { + gfc_error ("Parameter array '%s' at %L must have an explicit shape", + sym->name, &sym->declared_at); return; } /* Make sure that character string variables with assumed length are - dummy argument. */ + dummy arguments. */ if (sym->attr.flavor == FL_VARIABLE && !sym->attr.result && sym->ts.type == BT_CHARACTER