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/32535] New: namelist with private items contained in sub-sub-procedure of a module rejected


Janus, how about submitting a patch for this bug including a testcase?

As Janus Weil found out:
http://gcc.gnu.org/ml/fortran/2007-06/msg00488.html

If a namelist in a procedure contained in a module procedure contains a private
item as element, a bogus error message is printed:
   Error: PRIVATE symbol 'r' cannot be member of PUBLIC namelist at (1)

This fails if the symbol is not in the parent, but in the parent->parent
namespace.
One solution would be to add
    && !(sym->ns->parent->parent == nl->sym->ns)

module mod
  real, private :: r
contains
  subroutine x
  contains
    subroutine y
      namelist /n/ r
    end subroutine y
  end subroutine x
end module mod
end


-- 
           Summary: namelist with private items contained in sub-sub-
                    procedure of a module rejected
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32535


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