1! { dg-do run }
2!
3! PR fortran/41479
4!
5! Contributed by Juergen Reuter.
6!
7program main
8 type :: container_t
9    integer :: n = 42
10    ! if the following line is omitted, the problem disappears
11    integer, dimension(:), allocatable :: a
12 end type container_t
13
14 type(container_t) :: container
15
16 if (container%n /= 42) call abort()
17 if (allocated(container%a)) call abort()
18 container%n = 1
19 allocate(container%a(50))
20 call init (container)
21 if (container%n /= 42) call abort()
22 if (allocated(container%a)) call abort()
23contains
24 subroutine init (container)
25   type(container_t), intent(out) :: container
26 end subroutine init
27end program main
28