| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! PR fortran/51869 |
| 4 |
! |
| 5 |
module soop_stars_class |
| 6 |
implicit none |
| 7 |
type soop_stars |
| 8 |
real ,dimension(:,:) ,allocatable :: position |
| 9 |
end type |
| 10 |
type show |
| 11 |
type(soop_stars) :: rocket |
| 12 |
end type |
| 13 |
contains |
| 14 |
function new_show(boom) |
| 15 |
type(soop_stars) ,intent(in) :: boom |
| 16 |
type(show) :: new_show |
| 17 |
new_show%rocket = boom |
| 18 |
end function |
| 19 |
end module |
| 20 |
|
| 21 |
program main |
| 22 |
use soop_stars_class |
| 23 |
implicit none |
| 24 |
|
| 25 |
type(soop_stars) :: fireworks |
| 26 |
type(show), allocatable :: july4 |
| 27 |
|
| 28 |
allocate (fireworks%position(2,2)) |
| 29 |
fireworks%position = 33.0 |
| 30 |
|
| 31 |
july4 = new_show(boom=fireworks) |
| 32 |
end program |