| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/101536 - ICE in gfc_conv_expr_descriptor |
| 3 |
|
| 4 |
program p |
| 5 |
type s |
| 6 |
class(*), allocatable :: c |
| 7 |
end type |
| 8 |
type t |
| 9 |
class(*), allocatable :: c(:) |
| 10 |
end type t |
| 11 |
type u |
| 12 |
integer :: c(2) |
| 13 |
end type |
| 14 |
type(t) :: x |
| 15 |
x%c = [1,2,3,4] |
| 16 |
! print *, size (x) |
| 17 |
print *, size (x%c) |
| 18 |
print *, size (x%c(1)) ! { dg-error "must be an array" } |
| 19 |
contains |
| 20 |
integer function f(x, y, z) |
| 21 |
class(t), allocatable :: x(:) |
| 22 |
class(u) :: y(:) |
| 23 |
class(s) :: z |
| 24 |
f = size (x) |
| 25 |
f = size (x(1)) ! { dg-error "must be an array" } |
| 26 |
f = size (y) |
| 27 |
f = size (y%c(1)) |
| 28 |
f = size (y(2)%c) |
| 29 |
f = size (y(2)%c(1)) ! { dg-error "must be an array" } |
| 30 |
f = size (z) ! { dg-error "must be an array" } |
| 31 |
f = size (z% c) ! { dg-error "must be an array" } |
| 32 |
end |
| 33 |
end |