aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/proc_ptr_comp_7.f90
blob: 48fd5219e4a32a04479d9867ae26d24486bb77d6 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
! { dg-do compile }
!
! PR 40089: Public type with public component which has a private type
!
! Original test case by Juergen Reuter <reuter@physik.uni-freiburg.de>
! Adapted by Janus Weil <janus@gcc.gnu.org>

module m

  implicit none
  private

  public :: public_t

  type :: private_t
    integer :: i
  end type

  type :: public_t
     type(private_t), pointer :: public_comp_with_private_type
     procedure(ifc) , nopass, pointer :: ppc
  end type

  abstract interface
     integer function ifc ()
     end function
  end interface

end module m

program test
use m
implicit none
type(public_t) :: x
integer :: j
j = x%ppc()
end