https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52010
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |damian at sourceryinstitute dot or | |g --- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> --- In fact, it appears that both tests are fixed by the current patch in PR63205. This works fine: module m_test implicit none type ta private integer :: i = 99 contains procedure :: suba end type ta type tb private class(ta), pointer :: pa => null() contains procedure :: disp end type tb contains function suba( a, v) result(b) class(ta), target, intent(inout) :: a type(tb) :: b integer :: v a%i = v b%pa => a end function suba subroutine disp (arg) class(tb), intent(in) :: arg print *, arg%pa%i end subroutine end module m_test use m_test class(ta), allocatable :: tgt type(tb) :: PTR allocate (tgt) ptr = tgt%suba(42) call ptr%disp deallocate (tgt) end Paul