PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / typebound_operator_17.f90
blob4e58a7fa27a416497b641929f63239164bc651d6
1 ! { dg-do compile }
3 ! PR 54832: [4.8 Regression] [OOP] Type-bound operator not picked up with RESULT variable
5 ! Contributed by Damian Rouson <rouson@sandia.gov>
7 type, abstract :: integrand
8 contains
9 procedure(t_interface), deferred :: t
10 procedure(assign_interface), deferred :: assign
11 procedure(times_interface), deferred :: times
12 generic :: operator(*) => times
13 generic :: assignment(=) => assign
14 end type
16 abstract interface
17 function t_interface(this) result(dState_dt)
18 import :: integrand
19 class(integrand) ,intent(in) :: this
20 class(integrand) ,allocatable :: dState_dt
21 end function
22 function times_interface(lhs,rhs)
23 import :: integrand
24 class(integrand) ,intent(in) :: lhs
25 class(integrand) ,allocatable :: times_interface
26 real, intent(in) :: rhs
27 end function
28 subroutine assign_interface(lhs,rhs)
29 import :: integrand
30 class(integrand) ,intent(in) :: rhs
31 class(integrand) ,intent(inout) :: lhs
32 end subroutine
33 end interface
35 contains
37 subroutine integrate(model,dt)
38 class(integrand) :: model
39 real dt
40 model = model%t()*dt
41 end subroutine
43 end