This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [patch, fortran] PR 32535 - namelist with private items contained in sub-sub-procedure of a module rejected


Hi all,

I check the patch in (see below). r126706
I regtested the patch successfully under x86-64/Linux.

Thanks to Janus for the bugreport and patch,
thanks for Steve for (pre)reviewing the patch.

Tobias

PS: Sorry for breaking the thread.


Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog     (Revision 126704)
+++ gcc/testsuite/ChangeLog     (Arbeitskopie)
@@ -1,3 +1,8 @@
+2007-07-17  Janus Weil  <jaydub66@gmail.com>
+
+       PR fortran/32535
+       * gfortran.dg/pr32535.f90: New test.
+
 2007-07-17  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31320
Index: gcc/testsuite/gfortran.dg/pr32535.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr32535.f90       (Revision 0)
+++ gcc/testsuite/gfortran.dg/pr32535.f90       (Revision 0)
@@ -0,0 +1,26 @@
+! { dg-do compile }
+!
+! PR32535: namelist with private items contained in sub-sub-procedure
of a module rejected
+!
+! Contributed by Janus Weil <jaydub66@gmail.com>
+
+module mo
+implicit none
+real, private:: a,b,c
+
+contains
+
+  subroutine sub
+    implicit none
+    namelist /nl1/ a,b,c
+
+    contains
+
+    subroutine subsub
+      implicit none
+      namelist /nl2/ a,b,c
+    end subroutine subsub
+  end subroutine sub
+end module mo
+
+! { dg-final { cleanup-modules "mo" } }
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog       (Revision 126704)
+++ gcc/fortran/ChangeLog       (Arbeitskopie)
@@ -1,3 +1,9 @@
+2007-07-17  Janus Weil  <jaydub66@gmail.com>
+
+       PR fortran/32535
+       * resolve.c (resolve_fl_namelist): Check for namelist private
+       components in contained subprograms.
+
 2007-07-17  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31320
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (Revision 126704)
+++ gcc/fortran/resolve.c       (Arbeitskopie)
@@ -6969,6 +6969,8 @@
        {
          if (!nl->sym->attr.use_assoc
              && !(sym->ns->parent == nl->sym->ns)
+             && !(sym->ns->parent
+                  && sym->ns->parent->parent == nl->sym->ns)
              && !gfc_check_access(nl->sym->attr.access,
                                   nl->sym->ns->default_access))
            {


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