| 1 |
!{ dg-do run } |
| 2 |
|
| 3 |
! Do not free procedure pointer components. |
| 4 |
! Contributed by Damian Rouson <[email protected]> |
| 5 |
|
| 6 |
implicit none |
| 7 |
|
| 8 |
type foo_t |
| 9 |
integer, allocatable :: i_ |
| 10 |
procedure(f), pointer, nopass :: f_ |
| 11 |
procedure(c), pointer, nopass :: c_ |
| 12 |
end type |
| 13 |
|
| 14 |
class(foo_t), allocatable :: ff |
| 15 |
|
| 16 |
associate(foo => foo_t(1,f)) |
| 17 |
end associate |
| 18 |
|
| 19 |
contains |
| 20 |
|
| 21 |
function f() |
| 22 |
logical, allocatable :: f |
| 23 |
f = .true. |
| 24 |
end function |
| 25 |
|
| 26 |
function c() |
| 27 |
class(foo_t), allocatable :: c |
| 28 |
allocate(c) |
| 29 |
end function |
| 30 |
end |