On Friday, October 14, 2016 at 7:20:16 AM UTC-4, Arjen Markus wrote:
> ..
>
> The code is accepted by Intel Fortran 15.
>
> I tried it with gfortran 5.4.0 and I got the error you mentioned. Also if I drop the "result(f_ptr)" attribute and use the function name. So the "result" keyword is not the cause.
>
> ..
@Arjen,
Thanks for your follow-up. Yes, I too don't think the RESULT keyword is the cause, a simpler version of the code in the original post compiles ok, see below.
My hunch is this probably is a Fortran 2003 feature not fully supported yet in the context of type-bound procedures.
-- a variation --
module m
implicit none
abstract interface
function I_f() result( j )
integer :: j
end function I_f
end interface
procedure(I_f), pointer :: f
contains
function get_f() result( f_ptr )
procedure(I_f), pointer :: f_ptr
f_ptr => f
return