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

New associate feature problem with pure

Andrew_Smith
Valued Contributor I
533 Views
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 Kudos
2 Replies
Steven_L_Intel1
Employee
533 Views
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.
0 Kudos
Steven_L_Intel1
Employee
533 Views
This is fixed in the current 11.1 release.
0 Kudos
Reply