[4.9.2,5.1.0,6.0.0] procedure pointer component & non-component interpreted as different type or kind
Damian Rouson
damian@sourceryinstitute.org
Tue Jun 9 04:07:00 GMT 2015
GFortran Developers,
Gfortran 4.9.2, 5.1.0, and 6.0.0 each interpret a procedure pointer that is a derived type component as having a different type or kind from a procedure pointer that is of the same type and kind but is not a component. I just submitted the code below as Bug 66465 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66465). This code compiles cleanly with the NAG, Portland Group, Cray, and Intel compilers.
Damian
$ cat procptr.f90
interface
subroutine HandlerInterface
end
end interface
type TextHandlerTestCase
procedure (HandlerInterface), nopass, pointer :: handlerOut=>null()
end type
type(TextHandlerTestCase) this
procedure (HandlerInterface), pointer :: procPtr=>null()
print*, associated(procPtr, this%handlerOut)
end
$ gfortran procptr.f90
procptr.f90:10:30:
print*, associated(procPtr, this%handlerOut)
1
Error: ‘target’ argument of ‘associated’ intrinsic at (1) must be the same type and kind as ‘pointer’
$ gfortran --version
GNU Fortran (GCC) 6.0.0 20150607 (experimental)
More information about the Fortran
mailing list