| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR fortran/51953 |
| 4 |
! |
| 5 |
! |
| 6 |
type t |
| 7 |
end type t |
| 8 |
|
| 9 |
class(t), allocatable :: a, c(:), e(:) |
| 10 |
class(t), pointer :: b, d(:) |
| 11 |
|
| 12 |
allocate (a, b, source=c(1)) |
| 13 |
allocate (c(4), d(6), source=e) |
| 14 |
|
| 15 |
allocate (a, b, mold=f()) |
| 16 |
allocate (c(1), d(6), mold=g()) |
| 17 |
|
| 18 |
allocate (a, b, source=f()) |
| 19 |
allocate (c(1), d(6), source=g()) |
| 20 |
|
| 21 |
contains |
| 22 |
function f() |
| 23 |
class(t), allocatable :: f |
| 24 |
end function |
| 25 |
function g() |
| 26 |
class(t), allocatable :: g(:) |
| 27 |
end function |
| 28 |
end |