[Bug fortran/126517] Assigning an unallocated allocatable function result array to an allocatable causes segmentation fault

"kargl at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126517

Steve Kargl <kargl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from Steve Kargl <kargl at gcc dot gnu.org> ---
I think the code is invalid.

  F2023: 15.6.2.2 Function subprogram:
  ...
  If the function result is not a pointer, its value shall be defined
  by the function.  If the function result is a pointer, on return the
  pointer association status of the function result shall not be undefined.

The first sentence above indicates that the function
result needs be defined, and only way that can happen is if
the function result variable is allocated.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.