PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / typebound_assignment_2.f03
blobca994dd4dbef7e14e67c6bd1f8afd90b596e4938
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_grid
8   type :: grid_t
9    contains
10      procedure :: assign
11      generic   :: assignment(=) => assign
12   end type grid_t
13   public :: grid_t
14 contains
15   subroutine assign (this, that)
16     class(grid_t), intent(inout) :: this
17     class(grid_t), intent(in)    :: that
18   end subroutine assign
19 end module hydro_grid
21 module hydro_flow
22   use hydro_grid
23   type :: flow_t
24      class(grid_t), allocatable  :: gr
25   end type flow_t
26 contains
27   subroutine init_params (this)
28     class(flow_t), intent(out) :: this
29     type(grid_t)               :: gr
30    call init_comps(this, gr)
31   end subroutine init_params
32   subroutine init_comps (this, gr)
33     class(flow_t), intent(out) :: this
34     class(grid_t), intent(in)  :: gr
35     this%gr = gr
36   end subroutine init_comps
37 end module hydro_flow