This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31818] Wrongly accepts namelists with assumed-sized arrays
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jul 2007 13:49:05 -0000
- Subject: [Bug fortran/31818] Wrongly accepts namelists with assumed-sized arrays
- References: <bug-31818-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from burnus at gcc dot gnu dot org 2007-07-24 13:49 -------
Index: resolve.c
===================================================================
--- resolve.c (revision 126873)
+++ resolve.c (working copy)
@@ -7040,6 +7044,13 @@ resolve_fl_namelist (gfc_symbol *sym)
/* Reject namelist arrays that are not constant shape. */
for (nl = sym->namelist; nl; nl = nl->next)
{
+ if (nl->sym->as->type != AS_EXPLICIT)
+ {
+ gfc_error ("Variable '%s' at %L must have an explicit shape to "
+ "be in a NAMELIST", nl->sym->name, &sym->declared_at);
+ return FAILURE;
+ }
+
if (is_non_constant_shape_array (nl->sym))
{
gfc_error ("The array '%s' must have constant shape to be "
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31818