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

--- Comment #2 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #1)
> Confirmed.
> 
> Replacing
> 
>    allocate(x, source = f())
> 
> by a plain
> 
>    x => f()
> 
> works as expected.

OTOH, this is not semantically identical.

The variant:

  print *, c
  allocate (x)
  x = f()
  print *, c

shows that c is incremented by 3, so we invoke f() 3 times instead of just
once.  Confirmed by adding a print to f.

Reply via email to