3 ! The call to MOVE_ALLOC below caused a seg fault in runtime.
4 ! This was discussed in:
5 ! https://groups.google.com/forum/#!topic/comp.lang.fortran/ZVLqXFYDZ0M
6 ! Richard Maine proposed that the code violated the restrictions on
7 ! actual arguments in F2003 12.4.1.7 and so the fix asserts that the
8 ! TO and FROM arguments cannot be the same object or subobjects thereof.
11 program test_move_alloc
13 type(linked_list
), allocatable
:: link
16 type(linked_list
) :: test
19 allocate(test
% link
% link
)
20 call move_alloc(test
% link
, test
% link
% link
) ! { dg-error "aliasing restrictions" }
21 end program test_move_alloc