2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / alloc_comp_init_expr.f03
blob02ca7fc4e92c1f1f2758d69d8a4d475f213d3b9d
1 ! { dg-do compile }
2 ! PR fortran/34402 - allocatable components shall not be
3 ! data-initialized in init expr
5   type t
6     real, allocatable :: x(:)
7   end type
9   ! The following is illegal!
10   type (t) :: bad = t ( (/ 1., 3., 5., 7., 9. /) )     ! { dg-error "Invalid initialization expression" }
12   ! This is ok
13   type (t) :: ok = t ( NULL() )
14 end