diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-10-15 23:27:54 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-10-16 00:44:28 +0100 |
commit | e547d1341b1fe90672c9b982c4a98f8197237bb7 (patch) | |
tree | 7869c6a3d6a8475c539fda0d242f4034f3dff048 | |
parent | 929abc7fe3ad4491ac412ca232e055618559f268 (diff) | |
download | gcc-e547d1341b1fe90672c9b982c4a98f8197237bb7.zip gcc-e547d1341b1fe90672c9b982c4a98f8197237bb7.tar.gz gcc-e547d1341b1fe90672c9b982c4a98f8197237bb7.tar.bz2 |
libstdc++: Fix error in filesystem::path with Clang
THis fixes teh following error seen with Clang:
error: function '_S_convert<std::basic_string_view<char8_t>>' with deduced
return type cannot be used before it is defined
return string_type(_S_convert(std::u8string_view(__str)));
^
libstdc++-v3/ChangeLog:
* include/bits/fs_path.h (path::_S_convert(T)): Avoid recursive
call to function with deduced return type.
-rw-r--r-- | libstdc++-v3/include/bits/fs_path.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h index d13fb12..4bd9809 100644 --- a/libstdc++-v3/include/bits/fs_path.h +++ b/libstdc++-v3/include/bits/fs_path.h @@ -630,7 +630,8 @@ namespace __detail // Calling _S_convert<char8_t> will return a u8string_view that // refers to __str and would dangle after this function returns. // Return a string_type instead, to avoid dangling. - return string_type(_S_convert(std::u8string_view(__str))); + return string_type(_S_convert(__str.data(), + __str.data() + __str.size())); #endif else return _S_convert(__str.data(), __str.data() + __str.size()); |