This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40593] Proc-pointer returning function as actual argument
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jul 2009 08:39:37 -0000
- Subject: [Bug fortran/40593] Proc-pointer returning function as actual argument
- References: <bug-40593-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from janus at gcc dot gnu dot org 2009-07-01 08:39 -------
Related problem:
module m
contains
subroutine func()
print *,"42"
end subroutine func
end module m
program test
use m
implicit none
call sub(getPtr())
contains
subroutine sub(f)
procedure(func),pointer :: f
call f()
end subroutine sub
function getPtr()
procedure(func), pointer :: getPtr
getPtr => func
end function getPtr
end program test
is rejected with:
call sub(getPtr())
1
Error: Expected a procedure pointer for argument 'f' at (1)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40593