path64/compiler — Issue #126: pathf95: failure to write() output of procedure pointer
Author: Xarthisius
Created: 2011-11-10 12:52:16+00:00
State: open

Following code:

```fortran

module funcs
implicit none
public :: ala1
contains
real function ala1(x)
implicit none
real, intent(in) :: x
ala1 = x
end function ala1

end module funcs

program ala
use funcs, only: ala1
implicit none

type process_list
procedure(process_interface), pointer, nopass :: process
type(process_list), pointer :: next => null()
end type process_list

abstract interface
real function process_interface(x)
real, intent(in) :: x
end function process_interface
end interface

type(process_list), target :: p_list
type(process_list), pointer :: p

p_list%process => ala1
p => p_list

write(*,*) p_list%process(1.0)
write(*,*) p%process(1.0) !!!! fails with gfortran

end program ala
```
fails to compile, giving:

write(*,*) p_list%process(1.0)
^
pathf95-1707 pathf95-4.0.12: ERROR ALA, File = plist.f90, Line = 22, Column = 22
I/O list cannot contain a procedure pointer

write(*,*) p%process(1.0) !!!! fails with gfortran
^
pathf95-1707 pathf95-4.0.12: ERROR ALA, File = plist.f90, Line = 23, Column = 17
I/O list cannot contain a procedure pointer

pathf95: PathScale(TM) Fortran Version 4.0.12 (f14) Thu Nov 10, 2011 13:09:45
pathf95: 33 source lines
pathf95: 2 Error(s), 0 Warning(s), 0 Other message(s), 0 ANSI(s)
pathf95: "explain pathf95-message number" gives more information about each message