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

class(*) allocatable allocate internal compiler error

Patrice_l_
Beginner
2,001 Views

Hi,

the following allocatable statement produce a internal compiler, I am pretty sure this is forbidden though.

 

program foo
      implicit none
      
      class(*),allocatable :: val

      
      allocate(val,mold=null())
      allocate(val,source=null())
end program

 

0 Kudos
3 Replies
Steven_L_Intel1
Employee
2,001 Views

I agree that this is not allowed, though I am still looking for the right words in the standard to say so. That NULL() is not allocated and is being used in an expression suggests to me a violation of the rule about references to unallocated variables. Nevertheless, an internal compiler error is not the appropriate response and I will let the developers know. Thanks.

0 Kudos
Steven_L_Intel1
Employee
2,001 Views

Found it: "If source-expr is a pointer, it shall be associated with a target. If source-expr is allocatable, it shall be allocated." (6.7.1.2 Execution of an ALLOCATE statement, paragraph 5). Issue ID is DPD200375620.

0 Kudos
Steven_L_Intel1
Employee
2,001 Views

Fixed for a future major release.

0 Kudos
Reply