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/48810] New: [4.6/4.7 Regression] [OOP] TPB rejected because module is private


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

           Summary: [4.6/4.7 Regression] [OOP] TPB rejected because module
                    is private
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: janus@gcc.gnu.org


Reported by Andrew Baldwin at c.l.f, cf.
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/6e47d1d7271e4c02

The following program is accepted by NAG f95, by gfortran 4.5, and by Richard
Maine, but gfortran 4.6/4.7 reject it with:

      bar = foo%getx()
            1
Error: 'gimmex' of 'foobar' is PRIVATE at (1)


      module qtest
      type foobar
        integer :: x
        contains
        private
        procedure :: gimmex
        generic, public :: getx => gimmex
      end type foobar
      contains
        function gimmex(foo)
          class (foobar) :: foo
          integer :: gimmex
          gimmex = foo%x
        end function gimmex
      end module qtest

      program quicktest
      use qtest
      type (foobar) :: foo
      integer :: bar
      bar = foo%getx()
      end program quicktest


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