This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/31818] Wrongly accepts namelists with assumed-sized arrays



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]