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

New associate feature problem with pure

Andrew_Smith
傑出貢獻者 I
531 檢視
Try the following code:

pure subroutine foo

type Book
integer pages(10)
end type

type(Book) :: books(10)
integer i, j

do i = 1, 10
associate (aBook => books(i))
do j = 1, 10
aBook%pages(i) = i
end do
end associate
end do
end subroutine

It gives an error:

Error 1 error #7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure.

0 積分
2 回應
Steven_L_Intel1
531 檢視
This is a compiler bug and I can even guess what has gone wrong to trigger this. I have escalated this to development as issue DPD200117958. We apologize for the inconvenience.
Steven_L_Intel1
531 檢視
This is fixed in the current 11.1 release.
回覆