Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gfortran.dg / typebound_override_2.f90
1 ! { dg-do compile }
2 !
3 ! PR 47978: [OOP] Invalid INTENT in overriding TBP not detected
4 !
5 ! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
6
7 module foo_mod
8   type foo
9   contains
10     procedure, pass(f) :: bar => base_bar
11   end type foo
12 contains 
13   subroutine base_bar(f,j)
14     class(foo), intent(inout) :: f
15     integer, intent(in)    :: j
16   end subroutine base_bar
17 end module foo_mod
18
19 module extfoo_mod
20   use foo_mod
21   type, extends(foo) :: extfoo
22   contains
23     procedure, pass(f) :: bar => ext_bar  ! { dg-error "INTENT mismatch in argument" }
24   end type extfoo
25 contains 
26   subroutine ext_bar(f,j)
27     class(extfoo), intent(inout) :: f
28     integer, intent(inout) :: j
29   end subroutine ext_bar
30 end module extfoo_mod