aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_generic_10.f03
blob: 56952e1b90156da3ba4d060e4cfad99375cf0c9f (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 compile }
!
! PR 49196: [OOP] gfortran compiles invalid generic TBP: dummy arguments are type compatible
!
! Contributed by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>

module generic

  type :: a_type
   contains
     procedure :: a_subroutine
  end type a_type

  type,extends(a_type) :: b_type
   contains
     procedure :: b_subroutine
     generic :: g_sub => a_subroutine,b_subroutine  ! { dg-error "are ambiguous" }
  end type b_type

contains

  subroutine a_subroutine(this)
    class(a_type)::this
  end subroutine a_subroutine

  subroutine b_subroutine(this)
    class(b_type)::this
  end subroutine b_subroutine

end module generic