aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_override_2.f90
blob: 375875e734ab9b5a894e9e2dfce87af53c980290 (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 47978: [OOP] Invalid INTENT in overriding TBP not detected
!
! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>

module foo_mod
  type foo
  contains
    procedure, pass(f) :: bar => base_bar
  end type foo
contains 
  subroutine base_bar(f,j)
    class(foo), intent(inout) :: f
    integer, intent(in)    :: j
  end subroutine base_bar
end module foo_mod

module extfoo_mod
  use foo_mod
  type, extends(foo) :: extfoo
  contains
    procedure, pass(f) :: bar => ext_bar  ! { dg-error "INTENT mismatch in argument" }
  end type extfoo
contains 
  subroutine ext_bar(f,j)
    class(extfoo), intent(inout) :: f
    integer, intent(inout) :: j
  end subroutine ext_bar
end module extfoo_mod