aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/class_allocate_2.f03
blob: cec05f17a1f351c695e005f2c0a48daf1275f111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do compile }
!
! PR fortran/41582
!
subroutine test()
type :: t
end type t
class(t), allocatable :: c,d
allocate(t :: d)
allocate(c,source=d)
end

type, abstract :: t
end type t
type t2
  class(t), pointer :: t
end type t2

class(t), allocatable :: a,c,d
type(t2) :: b
allocate(a) ! { dg-error "requires a type-spec or source-expr" }
allocate(b%t) ! { dg-error "requires a type-spec or source-expr" }
end