view gcc/testsuite/gfortran.dg/associated_6.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do run }
!
! PR 54881: [4.8 Regression] [OOP] ICE in fold_convert_loc, at fold-const.c:2016
!
! Contributed by Richard L Lozes <richard@lozestech.com>

  implicit none

  type treeNode
    type(treeNode), pointer :: right => null()
  end type

  type(treeNode) :: n

  if (associated(RightOf(n))) STOP 1
  allocate(n%right)
  if (.not.associated(RightOf(n))) STOP 2
  deallocate(n%right)
  
contains

  function RightOf (theNode)
    class(treeNode), pointer :: RightOf
    type(treeNode), intent(in) :: theNode
    RightOf => theNode%right
  end function
  
end