- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
I've included code (below) that will reproduce the compiler errors I believe should not be there.
Turning on the reprocessor flag error_1 will reproduce an error related to a function returning a procedure pointer.Turning on the reprocessor flag error_2 will reproduce an error related to a procedure pointer component of a type as an actual argument in a subroutine.
Would be very greatful for your comments.
Code example:
module procs
type :: fem
integer :: type
procedure ( ), nopass, pointer :: bf => null()
end type fem
type(fem), pointer :: femi => null()
type(fem), pointer :: femr => null()
type(fem), pointer :: femc => null()
contains
subroutine pi( x )
integer :: x
write(*,*) x
end subroutine pi
subroutine pr( x )
real :: x
write(*,*) x
end subroutine pr
subroutine pc( x )
character(len=*) :: x
write(*,*) x
end subroutine pc
subroutine pps(c, pproc )
character* 1, intent(in) :: c
procedure ( ), pointer, intent(out) :: pproc
select case( c )
case( "i", "I" )
pproc => pi
case( "r", "R" )
pproc => pr
case( "c", "C" )
pproc => pc
end select
end subroutine pps
#ifdef error_1
function ppf(c) result( pproc )
character* 1, intent(in) :: c
procedure ( ), pointer :: pproc
select case( c )
case( "i", "I" )
pproc => pi
case( "r", "R" )
pproc => pr
case( "c", "C" )
pproc => pc
end select
end function ppf
#endif
subroutine new( )
procedure ( ), pointer :: proc
allocate( femi, femr, femc )
femi%type = 1
#ifdef error_2
call pps( "i", femi%bf )
#else
call pps( "i", proc )
femi%bf => proc
#endif
femr%type = 2
call pps( "r", proc )
femr%bf => proc
femc%type = 3
call pps( "c", proc )
femc%bf => proc
end subroutine new
end module procs
program test
use procs
procedure ( ), pointer :: pf
call new( )
call femi%bf( 5 )
call femr%bf( 10.0 )
call femc%bf( "Hi!" )
pf => pi
call pps( "i", pf )
call pf( 5 )
pf => pr
call pps( "r", pf )
call pf( 10.0 )
pf => pc
call pps( "c", pf )
call pf( "Hi!" )
end program test
I've included code (below) that will reproduce the compiler errors I believe should not be there.
Turning on the reprocessor flag error_1 will reproduce an error related to a function returning a procedure pointer.Turning on the reprocessor flag error_2 will reproduce an error related to a procedure pointer component of a type as an actual argument in a subroutine.
Would be very greatful for your comments.
Code example:
module procs
type :: fem
integer :: type
procedure ( ), nopass, pointer :: bf => null()
end type fem
type(fem), pointer :: femi => null()
type(fem), pointer :: femr => null()
type(fem), pointer :: femc => null()
contains
subroutine pi( x )
integer :: x
write(*,*) x
end subroutine pi
subroutine pr( x )
real :: x
write(*,*) x
end subroutine pr
subroutine pc( x )
character(len=*) :: x
write(*,*) x
end subroutine pc
subroutine pps(c, pproc )
character* 1, intent(in) :: c
procedure ( ), pointer, intent(out) :: pproc
select case( c )
case( "i", "I" )
pproc => pi
case( "r", "R" )
pproc => pr
case( "c", "C" )
pproc => pc
end select
end subroutine pps
#ifdef error_1
function ppf(c) result( pproc )
character* 1, intent(in) :: c
procedure ( ), pointer :: pproc
select case( c )
case( "i", "I" )
pproc => pi
case( "r", "R" )
pproc => pr
case( "c", "C" )
pproc => pc
end select
end function ppf
#endif
subroutine new( )
procedure ( ), pointer :: proc
allocate( femi, femr, femc )
femi%type = 1
#ifdef error_2
call pps( "i", femi%bf )
#else
call pps( "i", proc )
femi%bf => proc
#endif
femr%type = 2
call pps( "r", proc )
femr%bf => proc
femc%type = 3
call pps( "c", proc )
femc%bf => proc
end subroutine new
end module procs
program test
use procs
procedure ( ), pointer :: pf
call new( )
call femi%bf( 5 )
call femr%bf( 10.0 )
call femc%bf( "Hi!" )
pf => pi
call pps( "i", pf )
call pf( 5 )
pf => pr
call pps( "r", pf )
call pf( 10.0 )
pf => pc
call pps( "c", pf )
call pf( "Hi!" )
end program test
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As Steve is off for a few days, I will agree that you have demonstrated a problem which ought to be reported on premier.intel.com. Evidently, the implementation of this aspect of f2003 isn't complete, but the compiler should either implement it or give or give a more direct message about it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I thought maybe the first issue which causes an internal compiler error with newer compilers might already have been addressed, but your variant is not fixed by recent related fixes. I reported both of these to Development since you have done us the favor of providing a concise test case already.
I will update this thread as I learn more.
(error_1: Internal tracking id: DPD200119840)
(error_2: Internal tracking id: DPD200119887)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Both of these issues are fixed in the upcoming 11.1 release (May/June). I will post again when this release is available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As Steve previously announced (here), the 11.1 Release is now available, including fixes related to this thread.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page