* fi.po: Update.
[official-gcc.git] / gcc / testsuite / gfortran.dg / select_type_10.f03
blob0db9af9599e817c4be1600645c4c3c56f91f0116
1 ! { dg-do compile }
3 ! PR 42167: [OOP] SELECT TYPE with function return value
5 ! Contributed by Damian Rouson <damian@rouson.net>
7 module bar_module
9   implicit none
10   type :: bar
11     real ,dimension(:) ,allocatable :: f
12   contains
13     procedure :: total
14   end type
16 contains
18   function total(lhs,rhs)
19     class(bar) ,intent(in) :: lhs
20     class(bar) ,intent(in) :: rhs
21     class(bar) ,pointer :: total
22     select type(rhs)
23       type is (bar)
24         allocate(bar :: total)
25         select type(total)
26           type is (bar)
27             total%f = lhs%f + rhs%f
28         end select
29     end select
30   end function
32 end module