Debian Codegraph @

gcc/testsuite/gfortran.dg/proc_ptr_comp_7.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR 40089: Public type with public component which has a private type
4 !
5 ! Original test case by Juergen Reuter <[email protected]>
6 ! Adapted by Janus Weil <[email protected]>
7
8 module m
9
10 implicit none
11 private
12
13 public :: public_t
14
15 type :: private_t
16 integer :: i
17 end type
18
19 type :: public_t
20 type(private_t), pointer :: public_comp_with_private_type
21 procedure(ifc) , nopass, pointer :: ppc
22 end type
23
24 abstract interface
25 integer function ifc ()
26 end function
27 end interface
28
29 end module m
30
31 program test
32 use m
33 implicit none
34 type(public_t) :: x
35 integer :: j
36 j = x%ppc()
37 end