summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/typebound_call_28.f90
blob: 376c4c4f9ce6d9026f6a93faef3919d0102dddec (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
31
32
33
34
35
36
37
! { dg-do compile }
!
! PR 80766: [7/8 Regression] [OOP] ICE with type-bound procedure returning an array
!
! Contributed by Vladimir Fuka <vladimir.fuka@gmail.com>

module m1

  type :: base
  contains
     procedure :: fun
  end type

  type, extends(base) :: child
  end type

contains

  function fun(o) result(res)
    real :: res(3)
    class(base) :: o
    res = 0
  end function
end module


module m2
contains

  subroutine sub(o)
    use m1
    class(child) :: o
    real :: res(3)

    res = o%fun()
  end subroutine
end module