1! { dg-do compile }
2!
3! PR fortran/51055
4! PR fortran/45170 comment 14
5!
6! Contributed by Juha Ruokolainen
7! and Hans-Werner Boschmann
8!
9! gfortran was before checking whether the length
10! was a specification expression.
11!
12
13program a
14  character(len=:), allocatable :: s
15  integer :: i=10
16  allocate(character(len=i)::s)
17end program a
18