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/24534] New: gfortran: regression w/ PUBLIC derived types with private components


Hi,

the following valid code snippet recently stopped to compile cleanly:

module gfcbug28

  ! A publicly visible derived type with private components
  type, public :: my_t
     private
     type(offset_t) :: offset
  end type my_t

  ! Everything else is private...
  private

  type offset_t
     integer :: i
  end type offset_t

end module gfcbug28


I get:

 In file gfcbug28.f90:4

  type, public :: my_t
                     1
Error: The component 'offset' is a PRIVATE type and cannot be a component of
'my_t', which is PUBLIC at (1)


This is clearly nonsense.  Although the type "my_t" is PUBLIC,
its components are not.

Cheers,
-ha


-- 
           Summary: gfortran: regression w/ PUBLIC derived types with
                    private components
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de
  GCC host triplet: i686-pc-linux-gnu


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


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