Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / typebound_assignment_1.f03
blob2d06097902d0d226026622f000d737121993e417
1 ! { dg-do compile }
3 ! PR 47463: [OOP] ICE in gfc_add_component_ref
5 ! Contributed by Rich Townsend <townsend@astro.wisc.edu>
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
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
30     allocate(state_t :: this%st)
31     this%st = st
32   end subroutine init_comps
33 end module hydro_flow