gcc/testsuite/gfortran.dg/allocate_class_2.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! PR 52552: [OOP] ICE when trying to allocate non-allocatable object giving a dynamic type |
| 4 | ! |
| 5 | ! Contributed by <[email protected]> |
| 6 | |
| 7 | |
| 8 | type t |
| 9 | integer :: i |
| 10 | end type |
| 11 | |
| 12 | class(t) :: o ! { dg-error "must be dummy, allocatable or pointer" } |
| 13 | |
| 14 | allocate(t::o) ! { dg-error "is neither a data pointer nor an allocatable variable" } |
| 15 | |
| 16 | end |