summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_derived_5.f90
blob: 70d63aa1a4646bf4ae43d7ecd35aa746b7a3668f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do run }
!
! PR 45828: [4.6 Regression] No default initialization of derived type members?
!
! Contributed by Juha <jpr@csc.fi>

program fail1
   type a
      integer :: i
   end type a

   type b
     type(a) :: acomp = a(5)
   end type b

   type(b), allocatable :: c(:)

   allocate(c(1))
   if (c(1) % acomp % i /= 5) call abort()
end program fail1