gcc/testsuite/gfortran.dg/unlimited_polymorphic_33.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! PR fortran/101349 - ICE in gfc_get_descriptor_field |
| 3 | ! Check constraint F2008:C628 / F2018:C932 |
| 4 | |
| 5 | subroutine s(x) |
| 6 | class(*) :: x(:) |
| 7 | allocate (x, source=['abc']) ! { dg-error "must be ALLOCATABLE or a POINTER" } |
| 8 | end |
| 9 | |
| 10 | subroutine t(x) |
| 11 | class(*), allocatable :: x(:) |
| 12 | allocate (x, source=['abc']) |
| 13 | end |
| 14 | |
| 15 | subroutine u(x) |
| 16 | class(*), pointer :: x(:) |
| 17 | allocate (x, source=['abc']) |
| 18 | end |