1! { dg-do run } 2! PR fortran/89174 - this used to segfault on execution. 3! Test case by Neil Carlson. 4module mod 5 type :: array_data 6 class(*), allocatable :: mold 7 contains 8 procedure :: push 9 end type 10contains 11 subroutine push(this, value) 12 class(array_data), intent(inout) :: this 13 class(*), intent(in) :: value 14 allocate(this%mold, mold=value) ! <== SEGFAULTS HERE 15 end subroutine 16end module 17 18use mod 19type(array_data) :: foo 20call foo%push(42) 21end 22