Debian Codegraph @

gcc/testsuite/gfortran.dg/char_length_23.f90

raw
1 ! { dg-do compile }
2 !
3 ! Test the fix for PRs 96100 and 96101.
4 !
5 ! Contributed by Gerhardt Steinmetz <[email protected]>
6 !
7 program p
8 type t
9 character(:), allocatable :: c(:)
10 end type
11 type(t) :: x
12 character(:), allocatable :: w
13
14 ! PR96100
15 allocate(x%c(2), source = 'def')
16 associate (y => [x%c(1:1)]) ! ICE
17 print *,y
18 end associate
19
20 ! PR96101
21 associate (y => ([w(:)]))
22 print *, y ! ICE
23 end associate
24
25 end