c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / associated_6.f90
blob08bdf6cb3d492299b3798e707e4f39dc451ab6cf
1 ! { dg-do run }
3 ! PR 54881: [4.8 Regression] [OOP] ICE in fold_convert_loc, at fold-const.c:2016
5 ! Contributed by Richard L Lozes <richard@lozestech.com>
7 implicit none
9 type treeNode
10 type(treeNode), pointer :: right => null()
11 end type
13 type(treeNode) :: n
15 if (associated(RightOf(n))) STOP 1
16 allocate(n%right)
17 if (.not.associated(RightOf(n))) STOP 2
18 deallocate(n%right)
20 contains
22 function RightOf (theNode)
23 class(treeNode), pointer :: RightOf
24 type(treeNode), intent(in) :: theNode
25 RightOf => theNode%right
26 end function
28 end