https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64986
--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Further reduced test: program test implicit none type t integer :: ii end type t type, extends(t) :: v real, allocatable :: rr(:) end type v type(v) :: b(3) b = func7() ! scalar daughter type to array - alloc comps in parent type contains function func7() result(res) class(v), allocatable :: res allocate (res, source = v(3,[10.0,20.0])) end function func7 end program test