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