Debian Codegraph @

gcc/testsuite/gfortran.dg/proc_ptr_comp_46.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR 77596: [F03] procedure pointer component with implicit interface can point to a function
4 !
5 ! Contributed by toK <[email protected]>
6
7 program xxx
8 implicit none
9
10 type tf
11 procedure(), nopass, pointer :: fp
12 end type tf
13
14 call ass()
15
16 contains
17
18 integer function ff(x)
19 integer, intent(in) :: x
20 ff = x + 1
21 end function ff
22
23 subroutine ass()
24 type(tf) :: p
25 p%fp=>ff ! { dg-error "is not a subroutine" }
26 call p%fp(3)
27 end subroutine ass
28
29 end