| 1 |
! { dg-do run } |
| 2 |
! { dg-require-visibility "" } |
| 3 |
! |
| 4 |
! PR 84504: [F08] procedure pointer variables cannot be initialized with functions returning pointers |
| 5 |
! |
| 6 |
! Contributed by Sriram Swaminarayan <[email protected]> |
| 7 |
|
| 8 |
module test_mod |
| 9 |
implicit none |
| 10 |
private |
| 11 |
integer, target :: i = 333 |
| 12 |
procedure(the_proc), pointer, public :: ptr => the_proc |
| 13 |
contains |
| 14 |
function the_proc() |
| 15 |
integer, pointer :: the_proc |
| 16 |
the_proc => i |
| 17 |
end function |
| 18 |
end module |
| 19 |
|
| 20 |
program test_prog |
| 21 |
use test_mod |
| 22 |
integer, pointer :: ip |
| 23 |
ip => ptr() |
| 24 |
if (ip /= 333) stop 1 |
| 25 |
end |