OSDN Git Service

PR target/51393
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / typebound_assignment_1.f03
1 ! { dg-do compile }
2 !
3 ! PR 47463: [OOP] ICE in gfc_add_component_ref
4 !
5 ! Contributed by Rich Townsend <townsend@astro.wisc.edu>
6
7 module hydro_state
8   type :: state_t
9    contains
10      procedure :: assign
11      generic   :: assignment(=) => assign
12   end type state_t
13 contains
14   subroutine assign (this, that)
15     class(state_t), intent(inout) :: this
16     class(state_t), intent(in)    :: that
17   end subroutine assign
18 end module hydro_state
19
20 module hydro_flow
21   use hydro_state
22   type :: flow_t
23      class(state_t), allocatable :: st
24   end type flow_t
25 contains
26   subroutine init_comps (this, st)
27     class(flow_t), intent(out) :: this
28     class(state_t), intent(in) :: st
29
30     allocate(state_t :: this%st)
31     this%st = st
32   end subroutine init_comps
33 end module hydro_flow 
34
35 ! { dg-final { cleanup-modules "hydro_state hydro_flow" } }