https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71862
--- Comment #5 from Gerhard Steinmetz <gerhard.steinmetz.fort...@t-online.de> --- More test files : $ cat z5.f90 program p type t integer :: n = 0 integer, pointer :: q => null() end type type(t) :: x print *, associated(x%q) x = f() print *, associated(x%q) contains function f() result (z) class(t), allocatable :: z print *, associated(z%q) end end $ cat za1.f90 program p class(*), allocatable :: z(:) allocate (integer :: z(2)) select type (z) type is (integer) end select end