- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is fixed in the current 11.1 release.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page