- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I tried to track this one down and isolate the bug but I can't reproduce the same error. The bug comes from a constructor interface which take in input the class pointer directly from a function. This code gives an error #8212: Omitted field is not initialized. Field initialization missing: , but using the true function name works and using an intermediate pointer also works. I got this behavior with 15.0.2 and 16. Another similar setup but with more type redirection gives abstract_list.f90(57): error #6678: When the target is an expression it must deliver a pointer result. newLink => link(val, this%lastLink%nextLink()). this code is available online.
module tt
implicit none
public :: tata
type tata
class(*),pointer :: val
type(tata),pointer :: next
integer :: i
contains
procedure,pass :: returnpt
end type
interface tata
module procedure constructor
end interface
contains
function returnpt(this)
class(tata) :: this
class(tata),pointer :: returnpt
returnpt => this%next
end function
subroutine pp(this,val)
class(tata) :: this
class(*) :: val
class(tata),pointer :: pt,tk
tk => this%returnpt()
pt=>tata(val,tk)
pt=>constructor(val,tk)
pt=>constructor(val,this%returnpt())
pt=>tata(val,this%returnpt()) ! comment this and it works
end subroutine
function constructor(i,tk)
class(*) :: i
class(tata),pointer :: constructor,tk
allocate(constructor)
end function
end module tt
program toto
use tt
implicit none
class(*),pointer :: obj
class(tata),pointer :: pt
call pp(pt,obj)
end program toto
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to reproduce this. We'll escalate to the compiler developers, and let you know what they say.
Thanks for the report and clean test case!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A fix has been implemented for this issue and I have confirmed that your test case compiled successfully with a development compiler. The fix should be contained in the 16.0 release, we'll let you know when that's available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The 16.0 compiler has now been released as part of Intel Parallel Studio XE 2016. It is available for download from https://registrationcenter.intel.com with current support. I have confirmed that your test case compiles successfully with this compiler. Please let us know if you see any further problems.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page