aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_override_4.f90
blob: 95131dea3b81501fb23cb075c8b5c48fe5ed3044 (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
! { dg-do compile }
!
! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
!
! Contributed by Salvatore Filippone <filippone.salvatore@gmail.com>

module base_mod
  implicit none
  type base_type
  contains
    procedure, pass(map)  :: clone    => base_clone
  end type
contains
  subroutine  base_clone(map,mapout)
    class(base_type) :: map
    class(base_type) :: mapout
  end subroutine
end module

module r_mod
  use base_mod
  implicit none
  type, extends(base_type) :: r_type
  contains
    procedure, pass(map)  :: clone    => r_clone   ! { dg-error "Type mismatch in argument" }
  end type
contains
  subroutine  r_clone(map,mapout)
    class(r_type) :: map
    class(r_type) :: mapout
  end subroutine
end module

! { dg-final { cleanup-modules "base_mod r_mod" } }