- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This code re-produces:
module A
implicit none
interface
pure real module function getItem(id) result(res)
integer, intent(in) :: id
pointer :: res
end
end interface
real, target :: items(10)
end module
submodule(A) A1
implicit none
contains
pure real module function getItem(id) result(res)
integer, intent(in) :: id
pointer :: res
res => items(id)
end
end submodule
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But
module A
implicit none
interface
pure module function getItem(id)
integer, intent(in) :: id
real, pointer :: getItem
end function getItem
end interface
real, target :: items(10)
end module
submodule(A) A1
implicit none
contains
module procedure getItem
getItem => items(id)
end procedure getItem
end submodule
this form does not have an ICE or Compile errors.... I do not like to use this form BTW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reporting this and for the convenient reproducer. It reproduces with current (17.0) and previous (16.0) compilers. I reported it to Development.
(Internal tracking id: DPD200418366)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin,
Please note also the "module procedure" variant by Andrew in Message #2 should throw a compiler error about the invalid pointer assignment in a PURE procedure. Intel Fortran compiler misses out on it, can you please investigate and followup as needed?
Thanks much,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you FortranFan. I submitted that one also. I was wondering about that earlier in regard to the original case too.
(Internal tracking id: DPD200418373 - Missing error for invalid pointer assignment in a PURE procedure)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page