aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/proc_ptr_comp_34.f90
blob: 031f74418ca33e289767a6084b212159930486b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
! { dg-do run }
!
! PR 51082: [F03] Wrong result for a pointer to a proc-pointer component
!
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>

program ala
  implicit none

  type process_list
    procedure(ala1), pointer, nopass :: process
  end type

  type(process_list), target  :: p_list
  type(process_list), pointer :: p

  p_list%process => ala1
  p => p_list

   write(*,*) p_list%process(1.0)
   write(*,*) p%process(1.0)       !!!! failed

contains

  real function ala1(x)
    real, intent(in) :: x
    ala1 = x
  end function

end program