https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121425
--- Comment #1 from federico <federico.perini at gmail dot com> --- This slightly better example shows that the same error also shows up if the variable is typed, but from an allocatable polymorphic: https://godbolt.org/z/3j6zKPnK5 ``` module types use iso_fortran_env, only: rp => real64 type :: vec real(rp) :: xyz(3) = 0 end type vec type :: ax type(vec) :: p type(vec) :: n end type ax contains subroutine use_class(v) class(vec), intent(in) :: v ! no error if `type(vec)` class(vec), allocatable :: w type(ax) :: aa allocate(vec :: w); w%xyz = [1,2,3] aa = ax(p=w,n=vec([1,0,0])); call check_a(aa,'with polymorphic variable') aa = ax(p=v,n=vec([1,0,0])); call check_a(aa,'with `CLASS(), intent(in)`') contains subroutine check_a(aa,msg) type(ax), intent(in) :: aa character(*), intent(in) :: msg if (any(nint(aa%p%xyz)/=[1,2,3])) then print *, 'n=',aa%n%xyz print *, 'p=',aa%p%xyz error stop 'invalid default constructor '//msg endif end subroutine check_a end subroutine use_class end module types program t use types type(vec) :: x x = vec([1,2,3]) call use_class(x) end program t ```