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

            Bug ID: 119349
           Summary: [15 Regression] polymorphic array dummy argument with
                    function result actual argument in elemental function
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at archaeologic dot codes
  Target Milestone: ---

% cat all.f90 
  implicit none

  type string_t
    character(len=:), allocatable :: string_
  end type

  print *, true([string()])

contains

  type(string_t) function string()
    string%string_ = ""
  end function

  logical elemental function true(rhs)
    class(string_t), intent(in) :: rhs
    true = .true.
  end function

end

% gfortran all.f90 

% ./a.out
a.out(28435,0x209bdc840) malloc: *** error for object 0x600002f98060: pointer
being freed was not allocated
a.out(28435,0x209bdc840) malloc: *** set a breakpoint in malloc_error_break to
debug

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x1028d2563
#1  0x1028d14e3
#2  0x1a02a2de3
#3  0x1a026bf6f
#4  0x1a0178907
#5  0x1a0081e37
#6  0x1a00859bb
#7  0x1a00a4143
#8  0x102583bdf
#9  0x102583daf
zsh: abort      ./a.out

% gfortran --version
GNU Fortran (GCC) 15.0.1 20250315 (experimental)

Reply via email to