| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-O0" } |
| 3 |
! Tests patch for PR24158 - The module would compile, in spite |
| 4 |
! of the recursion between the derived types. This would cause |
| 5 |
! an ICE in the commented out main program. The standard demands |
| 6 |
! that derived type components be already defined, to break |
| 7 |
! recursive derived type definitions. |
| 8 |
! |
| 9 |
! Contributed by Paul Thomas <[email protected]> |
| 10 |
! |
| 11 |
module snafu |
| 12 |
type :: a |
| 13 |
integer :: v |
| 14 |
type(b) :: i ! { dg-error "not been previously defined" } |
| 15 |
end type a |
| 16 |
type :: b |
| 17 |
type(a) :: i |
| 18 |
end type b |
| 19 |
type (a) :: foo |
| 20 |
end module snafu |
| 21 |
|
| 22 |
! use snafu |
| 23 |
! foo%v = 1 |
| 24 |
! end |