summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_with_typespec_7.f90
blob: feb6c8c16cf0aee4ee3f3f0dd19e019e82bfee75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
! { dg-do compile }
! PR Fortran/83093
! Contributed by Gerhard Steinmetz  <gscfq at t-online dot de>
program p
   integer, parameter :: n(2) = [1,2]
   real :: x = 2
   character(:), allocatable :: z, zz, zzz
   character(:), allocatable :: y, yy
   allocate (character(a) :: z)     ! { dg-error "Scalar INTEGER expression" }
   allocate (character(x) :: zz)    ! { dg-error "Scalar INTEGER expression" }
   allocate (character((1.0)) :: z) ! { dg-error "Scalar INTEGER expression" }
   allocate (character(y) :: y)     ! { dg-error "Scalar INTEGER expression" }
   allocate (character(n(1:2)) :: y)! { dg-error "Scalar INTEGER expression" }
end