3 ! Check that pr106576 is fixed. The temporary from the function result
4 ! was not being finalized.
6 ! Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
15 interface assignment (=)
16 module procedure
assign
17 end interface assignment (=)
18 character(16) :: buffer(4)
19 integer :: buffer_count
= 1
22 subroutine assign (rop
, op
)
23 type(foo
), intent(inout
) :: rop
24 type(foo
), intent(in
) :: op
26 write (buffer(buffer_count
), '(A12,I4)') "assign", rop
%n
27 buffer_count
= buffer_count
+ 1
30 function to_foo(n
) result(res
)
31 integer, intent(in
) :: n
34 write (buffer(buffer_count
), '(A12,I4)') "to_foo", res
%n
35 buffer_count
= buffer_count
+ 1
38 subroutine cleanup (self
)
39 type (foo
), intent(inout
) :: self
40 write (buffer(buffer_count
), '(A12,I4)') "cleanup", self
%n
41 buffer_count
= buffer_count
+ 1
42 end subroutine cleanup
48 character(16) :: check(4) = [" to_foo 3", &
53 if (any (buffer
.ne
. check
)) stop 1