aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr106999.f90
blob: f05a27006f6837754524ad85c45290fbf496cbd9 (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
31
32
33
! { dg-do compile }
! Test the fix for PR106999
! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
program p
   type t
      integer :: i
      procedure(g), pointer :: f
   end type
   class(t), allocatable :: y, z
   procedure(g), pointer :: ff
   allocate (z)
   z%i = 42
   z%f => g
   ff => g
   call r(z%f)
   call s(z%f) ! { dg-error "Interface mismatch in dummy procedure" }
   call s(ff)  ! { dg-error "Interface mismatch in dummy procedure" }
contains
   subroutine g(x)
      class(t) :: x
      x%i = 84
   end
   subroutine r(x)
      procedure(g) :: x
      print *, "in r"
      allocate (y)
      call x(y)
      print *, y%i
   end
   subroutine s(x)
      class(*) :: x
   end subroutine
end