5 ! This was failing as the DECL of the proc pointer "func"
6 ! was used for the interface of the proc-pointer component "my_f_ptr"
7 ! rather than the decl of the proc-pointer target
9 ! Contributed by palott@gmail.com
15 ! NOTE: "func" is a procedure pointer!
20 real, intent (in
) :: z
25 procedure (func
), pointer, nopass
:: my_f_ptr
26 end type Contains_f_ptr
31 real, intent (in
) :: x
40 real, intent (in
) :: x
47 function fancy (func
, x
)
49 real, intent (in
) :: x
58 fancy
= func (x
) + 3.3 * x
61 end module ExampleFuncs
68 type (Contains_f_ptr
), dimension (2) :: NewType
70 !NewType(1) % my_f_ptr => f1
71 NewType(2) % my_f_ptr
=> f2
73 !write (*, *) NewType(1) % my_f_ptr (3.0), NewType(2) % my_f_ptr (3.0)
74 write (6, *) NewType(2) % my_f_ptr (3.0) ! < Shall print '27.0'
77 end program test_proc_ptr