[Bug fortran/109066] Segfault when using defined assignment
paul.richard.thomas at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Mar 10 08:12:34 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109066
--- Comment #4 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> ---
Hi Steve,
Indeed - I found that paragraph shortly after writing. Thanks for posting
it.
Cheers
Paul
On Thu, 9 Mar 2023 at 15:33, kargl at gcc dot gnu.org <
gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109066
>
> kargl at gcc dot gnu.org changed:
>
> What |Removed |Added
>
> ----------------------------------------------------------------------------
> CC| |kargl at gcc dot gnu.org
>
> --- Comment #3 from kargl at gcc dot gnu.org ---
> (In reply to Paul Thomas from comment #2)
> > Hi Andrew,
> >
> > Thanks for the report. However, IMHO the code is invalid since the
> result of
> > hdf5Constructor is not defined.
> >
> > function hdf5Constructor() result(self)
> > implicit none
> > type(hdf5Object) :: self
> > self = hdf5Object (resourceManager())
> > return
> > end function hdf5Constructor
> >
> > works a treat.
> >
> > If there is a requirement in the standard that a function result such as
> > this be initialised, I am unable to find it in the F2018 standard.
> >
> > Paul
>
> F2018, page 319.
> 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.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
More information about the Gcc-bugs
mailing list