| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/68569 - ICE with automatic character object and DATA |
| 3 |
! Contributed by G. Steinmetz |
| 4 |
|
| 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 |
| 11 |
|
| 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 |
| 18 |
|
| 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 |