Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / alloc_comp_constraint_1.f90
blobcb5ac0611d6d41c1dcace1f0598c0259044eb3cf
1 ! { dg-do compile }
2 ! Check that we don't allow IO or NAMELISTs with types with allocatable
3 ! components (PR 20541)
4 program main
6 type :: foo
7 integer, allocatable :: x(:)
8 end type foo
10 type :: bar
11 type(foo) :: x
12 end type bar
14 type(foo) :: a
15 type(bar) :: b
16 namelist /blah/ a ! { dg-error "cannot have ALLOCATABLE components" }
18 write (*, *) a ! { dg-error "cannot have ALLOCATABLE components" }
20 read (*, *) b ! { dg-error "cannot have ALLOCATABLE components" }
22 end program main