libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / typebound_override_2.f90
blob375875e734ab9b5a894e9e2dfce87af53c980290
1 ! { dg-do compile }
3 ! PR 47978: [OOP] Invalid INTENT in overriding TBP not detected
5 ! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
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
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