Closed band-a-prend closed 1 year ago
Thank you for reporting this issue with a detailed explanation. It seems related to #726 I am not sure why people would aim to move mem from one variable to the same variable.
@awvwgk Any idea on how to solve this issue?Maybe by creating a temp variable?
The issue is that we declare the second argument of move as intent(out)
, the only way to work with this would change the second argument to intent(inout)
.
Is this string meant? https://github.com/fortran-lang/stdlib/blob/df1e2f0ed0cbe2fbd9c1f20dcb5bd1a4bba95bb2/src/stdlib_string_type.fypp#L683
I tried to replace it with
type(string_type), intent(inout) :: to
but without success for the mentioned test: it still fails with gcc 13.
What about additional check instead smth. like
if (from%raw .neqv. to%raw) call move_alloc(from%raw, to%raw)
Or smth. that check if from
and to
already use the same memory, e.g. via loc
function?
But I need to check results.
Description
If Fortran stdlib build with GCC 13.2 when on running test the
string_intrinsic
test fail with error (debug mode):Actually it could be related to https://github.com/fortran-lang/stdlib/blob/df1e2f0ed0cbe2fbd9c1f20dcb5bd1a4bba95bb2/test/string/test_string_intrinsic.f90#L716 because if simple test program
is tried to compile with GCC 13.2 then the compile error is arrised
If compiled with GCC 12.x then there is no error with
string_intrinsic
test.If comment the appropriate test (
stdlib/test/string/test_string_intrinsic.f90:716-718
) thenstring_intrinsic
is passedExpected Behaviour
All tests should be passed.
Version of stdlib
0.2.1, 0.3.0
Platform and Architecture
Gentoo Linux
Additional Information
The build and testing are made with Gentoo package manager to package Fortran
stdlib
for Gentoo Guru (maintained by users) repository.Related issue: https://bugs.gentoo.org/910241