gcc/testsuite/gfortran.dg/pr89344.f90
raw| 1 | ! { dg-do compile } |
| 2 | program demo_setval |
| 3 | call setval(value) |
| 4 | write(*,*)'VALUE=',value |
| 5 | contains |
| 6 | subroutine setval(value) |
| 7 | class(*),intent(in) :: value |
| 8 | select type(value) |
| 9 | type is (integer) |
| 10 | value = 10 ! { dg-error "in variable definition context" } |
| 11 | type is (real) |
| 12 | value = 10.20 ! { dg-error "in variable definition context" } |
| 13 | end select |
| 14 | end subroutine setval |
| 15 | end program demo_setval |