Debian Codegraph @

gcc/testsuite/gfortran.dg/pdt_35.f03

raw
1 ! { dg-do compile }
2 !
3 ! Tests the fixes for PR82943.
4 !
5 ! This test focuses on inheritance for the type bound procedures.
6 !
7 ! Contributed by Alexander Westbrooks <[email protected]>
8 !
9 module m
10
11 public :: foo, bar, foobar
12
13 type, public :: goodpdt_lvl_0(a, b)
14 integer, kind :: a = 1
15 integer, len :: b
16 contains
17 procedure :: foo
18 end type
19
20 type, public, EXTENDS(goodpdt_lvl_0) :: goodpdt_lvl_1 (c)
21 integer, len :: c
22 contains
23 procedure :: bar
24 end type
25
26 type, public, EXTENDS(goodpdt_lvl_1) :: goodpdt_lvl_2 (d)
27 integer, len :: d
28 contains
29 procedure :: foobar
30 end type
31
32 contains
33 subroutine foo(this)
34 class(goodpdt_lvl_0(1,*)), intent(inout) :: this
35 end subroutine
36
37 subroutine bar(this)
38 class(goodpdt_lvl_1(1,*,*)), intent(inout) :: this
39 end subroutine
40
41 subroutine foobar(this)
42 class(goodpdt_lvl_2(1,*,*,*)), intent(inout) :: this
43 end subroutine
44
45 end module