| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! PR fortran/40851 |
| 4 |
! |
| 5 |
! Make sure the an INTENT(OUT) dummy is not initialized |
| 6 |
! when it is a pointer. |
| 7 |
! |
| 8 |
! Contributed by Juergen Reuter <[email protected]>. |
| 9 |
! |
| 10 |
program main |
| 11 |
|
| 12 |
type :: string |
| 13 |
character,dimension(:),allocatable :: chars |
| 14 |
end type string |
| 15 |
|
| 16 |
type :: string_container |
| 17 |
type(string) :: string |
| 18 |
end type string_container |
| 19 |
|
| 20 |
type(string_container), target :: tgt |
| 21 |
type(string_container), pointer :: ptr |
| 22 |
|
| 23 |
ptr => tgt |
| 24 |
call set_ptr (ptr) |
| 25 |
if (associated(ptr)) STOP 1 |
| 26 |
|
| 27 |
contains |
| 28 |
|
| 29 |
subroutine set_ptr (ptr) |
| 30 |
type(string_container), pointer, intent(out) :: ptr |
| 31 |
ptr => null () |
| 32 |
end subroutine set_ptr |
| 33 |
|
| 34 |
end program main |