| 1 |
! { dg-do compile } |
| 2 |
! { dg-options -std=f2003 } |
| 3 |
! Check that we don't allow IO of NAMELISTs with types with allocatable |
| 4 |
! components (PR 20541) |
| 5 |
program main |
| 6 |
|
| 7 |
type :: foo |
| 8 |
integer, allocatable :: x(:) |
| 9 |
end type foo |
| 10 |
|
| 11 |
type :: bar |
| 12 |
type(foo) :: x |
| 13 |
end type bar |
| 14 |
|
| 15 |
type(foo) :: a |
| 16 |
type(bar) :: b |
| 17 |
namelist /blah/ a ! This is allowed under F2003, but not F95 |
| 18 |
! The following require User Defined Derived Type I/O procedures. |
| 19 |
write (*, *) a ! { dg-error "cannot have ALLOCATABLE components" } |
| 20 |
|
| 21 |
read (*, *) b ! { dg-error "cannot have ALLOCATABLE components" } |
| 22 |
|
| 23 |
end program main |