Debian Codegraph @

gcc/testsuite/gfortran.dg/allocate_assumed_charlen_5.f90

raw
1 ! { dg-do compile }
2 ! PR fortran/119338 - check F2003:C626
3
4 module m
5 implicit none
6 contains
7 subroutine sub (s, c)
8 character(len=*), allocatable, intent(out) :: s(:)
9 character(len=*), allocatable, intent(out) :: c
10 allocate(s(5)) ! OK
11 allocate(c) ! OK
12 allocate(character(len=*) :: s(5)) ! OK
13 allocate(character(len=*) :: c) ! OK
14 allocate(character(len=10) :: s(5)) ! { dg-error "shall be an asterisk" }
15 allocate(character(len=10) :: c) ! { dg-error "shall be an asterisk" }
16 end subroutine sub
17 end module m