- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FYI,
17.07 compiler crashes with the code below. Workaround is to initialize the procedure pointer with "=>Null()". Support ticket has been submitted.
Module test
Interface
Module Subroutine bla1()
End Subroutine
end Interface
Procedure(bla1), pointer :: pbla=>bla1
end Module test
Submodule(test) subtest
contains
Module Procedure bla1
end Procedure
end Submodule subtest
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Indeed this gives an ICE with ifort 17.07. This seems to work at least with ifort 18.0.3 and ifort 19.0.0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have encountered a very similar problem, which was present in ifort19 beta, and which is not fixed in ifort19 (have not tested it, but was told so by support):
It is essential that (see code below):
(1) character(len=:) is used as type of result.
(2) the abstract interface ifc and the function fun are in a separate module.
I also found out that with integer instead of character(len=:) it works, but with logical it also fails...
All in all, I am a bit surprised that a beta version is made available, but almost no bugs I have reported where fixed (though most were not really serious). But this one is a bit cumbersome to work around (in the end I have copied the few concerned routines into the module where I required them).
module bar
implicit none
private
public ifc
public fun
abstract interface
function ifc() result(x)
character(len=:), allocatable :: x
end function ifc
end interface
contains
function fun() result(x)
character(len=:), allocatable :: x
x = ''
end function fun
end module bar
module mod
use bar
implicit none
private
type, public :: t
procedure(ifc), nopass, pointer, public :: f => fun
end type t
end module mod
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page