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 <reuter@physik.uni-freiburg.de>
6! Adapted by Janus Weil <janus@gcc.gnu.org>
7
8module 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
29end module m
30
31program test
32use m
33implicit none
34type(public_t) :: x
35integer :: j
36j = x%ppc()
37end
38