3 ! PR 41022: [F03] procedure pointer components as actual arguments
5 ! Contributed by Juergen Reuter <reuter@physik.uni-freiburg.de>
10 procedure(proc
), nopass
, pointer :: proc
=> null ()
13 type(container_t
), target
:: obj1
14 type(container_t
) :: obj2
17 call transfer_proc_ptr (obj2
, obj1
)
19 if (obj2
%proc()/=7) call abort()
23 subroutine transfer_proc_ptr (obj2
, obj1
)
24 type(container_t
), intent(out
) :: obj2
25 type(container_t
), intent(in
), target
:: obj1
26 call assign_proc_ptr (obj2
%proc
, obj1
)
27 end subroutine transfer_proc_ptr
29 subroutine assign_proc_ptr (ptr
, obj1
)
30 procedure(proc
), pointer :: ptr
31 type(container_t
), intent(in
), target
:: obj1
33 end subroutine assign_proc_ptr
35 integer function proc ()