aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/proc_ptr_comp_32.f90
blob: c1d01c52712220c9e1a8c9033e91dc8c399ddf57 (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
34
35
! { dg-do compile }
!
! PR 48095: [OOP] Invalid assignment to procedure pointer component not rejected
!
! Contributed by Arjen Markus <arjen.markus895@gmail.com>

module m

  implicit none

  type :: rectangle
    procedure(get_area), pointer :: get_special_area
  end type rectangle

  abstract interface
    real function get_area( this )
      import                       :: rectangle
      class(rectangle), intent(in) :: this
    end function get_area
  end interface

contains

  real function get_my_area( this )
    type(rectangle), intent(in) :: this
    get_my_area = 3.0
  end function get_my_area

end module


use m
type(rectangle) :: rect
rect%get_special_area => get_my_area  ! { dg-error "Interface mismatch in procedure pointer assignment" }
end