The following example produces a runtime recursion error during finalization with -fcheck=recursion. There is indeed recursion, but the final subroutine is declared recursive. module foo type :: list type(list), pointer :: next => null() contains final :: list_delete end type contains recursive subroutine list_delete (this) type(list), intent(inout) :: this if (associated(this%next)) deallocate(this%next) end subroutine end module foo program main use foo type(list), pointer :: x allocate(x) allocate(x%next) deallocate(x) end program
Duplicate of pr67505. *** This bug has been marked as a duplicate of bug 67505 ***