c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / data_char_6.f90
blob4e32c647d4d1eeb83183170e3b48ae1c31ace249
1 ! { dg-do compile }
2 ! PR fortran/68569 - ICE with automatic character object and DATA
3 ! Contributed by G. Steinmetz
5 subroutine s1 (n)
6 implicit none
7 integer, intent(in) :: n
8 character(n) :: x
9 data x /'a'/ ! { dg-error "Non-constant character length" }
10 end
12 subroutine s2 (n)
13 implicit none
14 integer, intent(in) :: n
15 character(n) :: x
16 data x(1:1) /'a'/ ! { dg-error "Non-constant character length" }
17 end
19 subroutine s3 ()
20 implicit none
21 type t
22 character(:) :: c ! { dg-error "must be a POINTER or ALLOCATABLE" }
23 end type t
24 type(t) :: tp
25 data tp%c /'a'/ ! { dg-error "Non-constant character length" }
26 end