[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / associate_35.f90
blob417ec7c426b37a9adeb114cb4a6b54cc4c1fc13e
1 ! { dg-do compile }
3 ! Test the fix for PR84115 comment #1 (except for s1(x)!).
5 ! Contributed by G Steinmetz <gscfq@t-online.de>
7 character(:), allocatable :: dum
8 dum = "s1"
9 call s1 (dum)
10 dum = "s2"
11 call s2 (dum)
12 dum = "s3"
13 call s3 (dum)
14 contains
15 subroutine s1(x)
16 character(:), allocatable :: x
17 associate (y => x//x) ! { dg-error "type character and non-constant length" }
18 print *, y
19 end associate
20 end
22 subroutine s2(x)
23 character(:), allocatable :: x
24 associate (y => [x])
25 print *, y
26 end associate
27 end
29 subroutine s3(x)
30 character(:), allocatable :: x
31 associate (y => [x,x])
32 print *, y
33 end associate
34 end
35 end