Debian Codegraph @

gcc/testsuite/gfortran.dg/pr124567.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR fortran/124567 - overriding method not resolved correctly
4 !
5 ! Contributed by Salvatore Filippone
6
7 module psb_base_spm_mod
8 type :: psb_base_spm
9 end type psb_base_spm
10 end module psb_base_spm_mod
11
12 module psb_r_base_spm_mod
13 use psb_base_spm_mod
14 type, extends(psb_base_spm) :: psb_r_base_spm
15 contains
16 procedure, pass(a) :: csgrw => psb_r_base_csgrw
17 end type psb_r_base_spm
18
19 interface
20 subroutine psb_r_base_csgrw(a,iren)
21 import
22 class(psb_r_base_spm), intent(in) :: a
23 integer, intent(in), optional :: iren(:)
24 end subroutine psb_r_base_csgrw
25 end interface
26 end module psb_r_base_spm_mod
27
28 module psb_d_mf_mat_mod
29 use psb_r_base_spm_mod
30 type, extends(psb_r_base_spm) :: psb_d_mf_spm
31 procedure(d_mf_mv), pass(a), pointer :: var_csmv => null()
32 contains
33 procedure, pass(a) :: csgrw => psb_d_mf_csgrw
34 procedure, pass(a) :: set_csmv => d_mf_set_csmv
35 end type psb_d_mf_spm
36
37 interface
38 subroutine d_mf_mv(a,x,info)
39 import :: psb_d_mf_spm
40 class(psb_d_mf_spm), intent(in) :: a
41 real, intent(in) :: x(:)
42 integer, intent(out) :: info
43 end subroutine d_mf_mv
44 end interface
45
46 interface
47 subroutine psb_d_mf_csgrw(a,iren)
48 import
49 class(psb_d_mf_spm), intent(in) :: a
50 integer, intent(in), optional :: iren(:)
51 end subroutine psb_d_mf_csgrw
52 end interface
53
54 contains
55 subroutine d_mf_set_csmv(func,a)
56 implicit none
57 class(psb_d_mf_spm), intent(inout) :: a
58 procedure(d_mf_mv) :: func
59 a%var_csmv => func
60 return
61 end subroutine d_mf_set_csmv
62 end module psb_d_mf_mat_mod