https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83976
--- Comment #1 from G. Steinmetz <gs...@t-online.de> --- This variant works as expected : $ cat z2.f90 program p type t integer :: a end type class(t), allocatable :: x type(t) :: z = t(3) x = z z = x print *, z end $ gfortran-8-20180121 z2.f90 -static-libgfortran $ a.out 3 $