aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/private_type_5.f90
blob: a6a417f176c2777741124d5ed179f805d5f4ff2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
! { dg-do compile }
! Tests the fix for PR26779, where an error would occur because
! init was detected to be public with a private type dummy argument.
!
! Contributed by Paul Thomas  <pault@gcc.gnu.org>
!
module test
  public sub
  type, private :: 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