view gcc/testsuite/gfortran.dg/class_allocate_2.f03 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { 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