modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_array_12.f03
blob9873db7b0bd5884db2d261f79c7ed01bdb0a3623
1 ! { dg-do compile }
3 ! PR fortran/51754
4 ! This program was leading to an ICE related to class arrays
6 ! Contributed by Andrew Benson <abenson@caltech.edu>
8 module test
9   private
11   type :: componentB
12   end type componentB
14   type :: treeNode
15      class(componentB), allocatable, dimension(:) :: componentB
16   end type treeNode
18 contains
20   function BGet(self)
21     implicit none
22     class(componentB), pointer :: BGet
23     class(treeNode), target, intent(in) :: self
24     select type (self)
25     class is (treeNode)
26        BGet => self%componentB(1)
27     end select
28     return
29   end function BGet
31 end module test