This error is generated by the example, given at the end of Metcalf, Reid and
Cohen; pointer.f90.  The following reduced testcase, illustartes it:

module test
  public sub
  type, private :: t
!  type :: t
    integer :: i
  end type t
contains
  subroutine sub (arg)
    integer arg
    type(t) :: root
    call init(root, arg)
  contains
    subroutine init(ir, i)
      integer i
      type(t) :: ir
      ir%i = i
    end subroutine init
  end subroutine sub
end module test

In file private.f90:11

    call init(root, arg)
            1
Error: 'ir' is of a PRIVATE type and cannot be a dummy argument of 'init',
which
 is PUBLIC at (1)

Being an internal procedure, init is NOT public by 2.2.3.3 of the F95 standard.
It should have access to all the symbols of the host, therefore this error is
wrong on both levels; ir cannot be private to it, nor is init public!

Needless to say, a patch is on its way!

Paul


-- 
           Summary: Internal module procedure may not have private type
                    dummy arguments
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paul dot richard dot thomas at cea dot fr


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

Reply via email to