gcc/testsuite/gfortran.dg/proc_ptr_38.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! PR 54387: [F03] Wrongly accepts non-proc result variable on the RHS of a proc-pointer assignment |
| 4 | ! |
| 5 | ! Contributed by James Van Buskirk |
| 6 | |
| 7 | integer function foo() |
| 8 | procedure(), pointer :: i |
| 9 | i => foo ! { dg-error "is invalid as proc-target in procedure pointer assignment" } |
| 10 | end |
| 11 | |
| 12 | recursive function bar() result (res) |
| 13 | integer :: res |
| 14 | procedure(), pointer :: j |
| 15 | j => bar |
| 16 | end |