blob: 2d37bbc7f8bd6edde46da8cd3b4c02b232964a5c [file] [log] [blame]
! { dg-do run }
! PR fortran/44047
! Double free happened, check that it works now.
! Contributed by Janus Weil, janus@gcc.gnu.org.
implicit none
type t0
integer :: j = 42
end type t0
type t
integer :: i
class(t0), allocatable :: foo
end type t
type(t) :: m
allocate(t0 :: m%foo)
m%i = 5
select type(bar => m%foo)
type is(t0)
print *, bar
if (bar%j /= 42) call abort ()
end select
end