This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Fix PR 13201
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: fortran at gcc dot gnu dot org, patch <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 09 Jun 2004 14:37:36 +0200
- Subject: Re: [gfortran] Fix PR 13201
- References: <40BB9B70.1080807@physik.uni-muenchen.de> <200406082344.14900.paul@codesourcery.com>
Here's what I committed. I changed the check to "sym->as->type !=
AS_EXPLICIT", as this seems correct and caused no adverse effects. I
also fixed an additional typo in the comment directly following.
- Tobi
Index: resolve.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/resolve.c,v
retrieving revision 1.4
diff -u -p -r1.4 resolve.c
--- resolve.c 18 May 2004 00:48:04 -0000 1.4
+++ resolve.c 9 Jun 2004 12:30:29 -0000
@@ -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