gcc/testsuite/gfortran.dg/class_array_10.f03
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! PR fortran/41587 |
| 4 | ! This program was leading to an ICE related to class allocatable arrays |
| 5 | ! |
| 6 | ! Contributed by Dominique D'Humieres <[email protected]> |
| 7 | |
| 8 | type t0 |
| 9 | integer :: j = 42 |
| 10 | end type t0 |
| 11 | type t |
| 12 | integer :: i |
| 13 | class(t0), allocatable :: foo(:) |
| 14 | end type t |
| 15 | type(t) :: k |
| 16 | allocate(t0 :: k%foo(3)) |
| 17 | print *, k%foo%j |
| 18 | end |