[Bug fortran/109846] [rejects valid] Pointer-valued function reference rejected as actual argument

2023-05-13 Thread neil.n.carlson at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109846

--- Comment #2 from Neil Carlson  ---
Amusing! I have a regression in 13.1 (which I need to create a reproducer for)
where the workaround for a segfault is to use a RESULT variable -- just the
opposite :-)

[Bug fortran/109846] [rejects valid] Pointer-valued function reference rejected as actual argument

2023-05-13 Thread kargl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109846

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
Confirmed.

Workaround seems to be to not use a RESULT variable.
This change seems to work

  function sublist(this)
class(parameter_list), intent(inout) :: this
class(parameter_list), pointer :: sublist
allocate(sublist)
  end function