gcc/testsuite/gfortran.dg/pr110415.f90
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! Contributed by Brad Richardson <[email protected]> |
| 4 | ! |
| 5 | type, abstract :: p |
| 6 | end type p |
| 7 | |
| 8 | type, extends(p) :: c |
| 9 | end type c |
| 10 | |
| 11 | class(p), allocatable :: a |
| 12 | |
| 13 | a = func() |
| 14 | contains |
| 15 | function func() result(a) |
| 16 | class(p), allocatable :: a |
| 17 | |
| 18 | a = c() |
| 19 | end function func |
| 20 | end program |