aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/allocate_with_typespec_5.f90
blob: 1f8b3d6c4d27d4fb423f23e8b82f02178b397afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
! { dg-do compile }
!
! PR fortran/51652
!
! Contributed by David Kinniburgh
!
module settings

type keyword
  character(60), allocatable :: c(:)
end type keyword

type(keyword) :: kw(10)

contains

subroutine save_kw
  allocate(character(80) :: kw(1)%c(10)) ! { dg-error "with type-spec requires the same character-length parameter" }
end subroutine save_kw

subroutine foo(n)
  character(len=n+2), allocatable :: x
  allocate (character(len=n+3) :: x) ! { dg-error "type-spec requires the same character-length parameter" }
end subroutine foo

end module settings