gcc/testsuite/gfortran.dg/alloc_comp_constraint_4.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! Tests the fix for PR29422, in which function results |
| 3 | ! were not tested for suitability in IO statements. |
| 4 | ! |
| 5 | ! Contributed by Dominique d'Humieres <[email protected]> |
| 6 | ! |
| 7 | Type drv |
| 8 | Integer :: i |
| 9 | Integer, allocatable :: arr(:) |
| 10 | End type drv |
| 11 | |
| 12 | print *, fun1 () ! { dg-error "cannot have ALLOCATABLE" } |
| 13 | |
| 14 | contains |
| 15 | Function fun1 () |
| 16 | |
| 17 | Type(drv) :: fun1 |
| 18 | fun1%i = 10 |
| 19 | end function fun1 |
| 20 | end |
| 21 |