https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117264

kargls at comcast dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargls at comcast dot net

--- Comment #3 from kargls at comcast dot net ---
(In reply to Vladimir Terzi from comment #2)
> (In reply to anlauf from comment #1)
> > Confirmed up to current trunk.
> > 
> > As a workaround, you may try the result clause on function f, e.g.:
> > 
> >   function f() result(r)
> >     class(t), allocatable :: r
> >     r=tt()
> >   end
> 
> But this workaround doesn't seem to change anything in my version of
> gfortran. I'm getting the same segfault.

Works for me with 13.2.0, 14.2.0, and top of tree on x86_64-*-freebsd.

You can also do the allocation explicitly instead of allocation 
on assignment.

      function f()
         class(t), allocatable :: f
         allocate(tt :: f)
      end

Reply via email to