In the following code a function is passed to subroutine foo, which then passes it to function foo2 (where it is used). When compiled with /checkmate you get a run-time saying that the second argument of the call to foo is not a procedure. This is the bug.
If the call to foo2 is removed, the program runs OK.
This bug has appeared since version 8.10; previously it worked in 8.05 and in earlier versions.
Note: I have only tried using the 32 bit compiler.
module kinds
integer, parameter :: dp=kind(1.0d0)
end module kinds
module mmm
use kinds, only: dp
type p_t
real(dp) :: a
real(dp) :: b
end type
contains
function mult(x)
real(dp) :: mult
real(dp), intent(in) :: x
mult = 2.0_dp*x
end function mult
subroutine foo(p, func)
type(p_t), intent(in) :: p
interface
function func(x)
use kinds, only: dp
real(dp) :: func
real(dp), intent(in) :: x
end function func
end interface
print *, foo2(func, 1.0_dp)
! If you replace the above line with this one it runs
!print *, func(1.0_dp)
print *, p%a, p%b
end subroutine foo
function foo2(func, x)
real(dp) :: foo2
real(dp), intent(in) :: x
interface
function func(x)
use kinds, only: dp
real(dp) :: func
real(dp), intent(in) :: x
end function func
end interface
foo2 = func(x)
end function foo2
end module mmm
program test
use mmm
type(p_t) :: p
p%a = 0.0_dp
p%b = 1.0_dp
call foo(p, mult)
end program test
Regards, David.