PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / init_char_with_nonchar_ctr.f90
blobb84a9a83c5016de52822218c6348e79537069d35
1 ! { dg-do compile }
3 ! Initialization of character by non-character constructor
5 subroutine s1
6 type t
7 integer :: n = 0
8 end type
9 type t2
10 character :: c = t() ! { dg-error "Can't convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
11 end type
12 end subroutine
14 subroutine s2
15 type t
16 end type
17 type t2
18 character :: c(1) = [t()] ! { dg-error "Can't convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
19 end type
20 end subroutine
22 subroutine s3
23 type t
24 integer :: a = 1
25 character :: c = t() ! { dg-error "Can't convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
26 end type
27 end subroutine
29 subroutine s4
30 type t
31 integer, allocatable :: a
32 character :: c = t() ! { dg-error "Can't convert TYPE\\(t\\) to CHARACTER\\(1\\)" }
33 end type
34 end subroutine