gcc/testsuite/gfortran.dg/class_53.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! PR 54778: [OOP] an ICE on invalid OO code |
| 4 | ! |
| 5 | ! Contributed by Sylwester Arabas <[email protected]> |
| 6 | |
| 7 | implicit none |
| 8 | |
| 9 | type :: arr_t |
| 10 | real :: at |
| 11 | end type |
| 12 | |
| 13 | type(arr_t) :: this |
| 14 | class(arr_t) :: elem ! { dg-error "must be dummy, allocatable or pointer" } |
| 15 | |
| 16 | elem = this ! { dg-error "Nonallocatable variable must not be polymorphic in intrinsic assignment" } |
| 17 | |
| 18 | end |