[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_comp_24.f90
blob8c935c9ea569a7e77a1562547278e8558df7828c
1 ! { dg-do compile }
3 ! PR42045: [F03] passing a procedure pointer component to a procedure pointer dummy
5 ! Contributed by John McFarland <john.mcfarland@swri.org>
7 PROGRAM prog
8 TYPE object
9 PROCEDURE(), POINTER, NOPASS :: f
10 END TYPE object
11 TYPE container
12 TYPE (object), POINTER :: o(:)
13 END TYPE container
14 TYPE (container) :: c
15 TYPE (object) :: o1, o2
16 PROCEDURE(), POINTER :: f => NULL()
17 o1%f => f
18 CALL set_func(o2,f)
19 CALL set_func(o2,o1%f)
20 ALLOCATE( c%o(5) )
21 c%o(5)%f => f
22 CALL set_func(o2,c%o(5)%f)
23 CONTAINS
24 SUBROUTINE set_func(o,f)
25 TYPE (object) :: o
26 PROCEDURE(), POINTER :: f
27 o%f => f
28 END SUBROUTINE set_func
29 END PROGRAM prog