Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29576 Discussions

class(*) pointer return function internal compiler error

Patrice_l_
Beginner
1,121 Views

Hi,

I get an internal compiler error with the following code, with both version 15.0.2 and 16 beta.  This code seems valid to me.

 

program toto
implicit none

class(*),pointer :: obj
integer,pointer :: v
integer :: i


i=1
obj => tete(i)
select type( vv => tete(i))  !! USING obj here works as expected.
type is (integer)
        print *,vv
class default
        print *,'unknown'
end select


contains

function tete(obj)
        class(*) :: obj
        class(*),pointer :: tete

        allocate(tete,source=obj)
end function        

end program toto

 

0 Kudos
2 Replies
pbkenned1
Employee
1,121 Views

Thanks for reporting the issue and providing a nice simple test case.  Looks like a straight bug to me.

>>>This code seems valid to me.

It's legit, but regardless, ICEs are never acceptable.  I'll report to the developers.

Patrick

 

0 Kudos
pbkenned1
Employee
1,121 Views

The dope vector is funky.  This has been reported to the developers, internal tracking ID DPD200370649.  I'll keep this thread updated with any news.

Patrick

0 Kudos
Reply