gcc/testsuite/gfortran.dg/class_allocate_2.f03
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! PR fortran/41582 |
| 4 | ! |
| 5 | subroutine test() |
| 6 | type :: t |
| 7 | end type t |
| 8 | class(t), allocatable :: c,d |
| 9 | allocate(t :: d) |
| 10 | allocate(c,source=d) |
| 11 | end |
| 12 | |
| 13 | type, abstract :: t |
| 14 | end type t |
| 15 | type t2 |
| 16 | class(t), pointer :: t |
| 17 | end type t2 |
| 18 | |
| 19 | class(t), allocatable :: a,c,d |
| 20 | type(t2) :: b |
| 21 | allocate(a) ! { dg-error "requires a type-spec or source-expr" } |
| 22 | allocate(b%t) ! { dg-error "requires a type-spec or source-expr" } |
| 23 | end |