| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/67804 - ICE on bad type in structure constructor in DATA statement |
| 3 |
! Contributed by G.Steinmetz |
| 4 |
|
| 5 |
program p |
| 6 |
type t |
| 7 |
character :: c |
| 8 |
end type |
| 9 |
type u |
| 10 |
character, pointer :: c |
| 11 |
end type |
| 12 |
type(t) :: x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 |
| 13 |
type(u) :: y6 |
| 14 |
data x0 /t('a')/ ! OK |
| 15 |
data x1 /t(1)/ ! { dg-error "Cannot convert" } |
| 16 |
data x2 /t(1.)/ ! { dg-error "Cannot convert" } |
| 17 |
data x3 /t(1d1)/ ! { dg-error "Cannot convert" } |
| 18 |
data x4 /t((0.,1.))/ ! { dg-error "Cannot convert" } |
| 19 |
data x5 /t(.true.)/ ! { dg-error "Cannot convert" } |
| 20 |
data x6 /t(null())/ ! { dg-error "neither a POINTER nor ALLOCATABLE" } |
| 21 |
data x7 /t(['1'])/ ! { dg-error "The rank of the element" } |
| 22 |
data x8 /t([1])/ ! { dg-error "Cannot convert" } |
| 23 |
data x9 /t(z'0')/ ! { dg-error "Cannot convert" } |
| 24 |
data y6 /u(null())/ ! OK |
| 25 |
end |