Message ID | YWoTbQJ2GUx8F0Gm@redhat.com |
---|---|
State | New |
Headers | show |
Series | [committed] libstdc++: Fix error in filesystem::path with Clang | expand |
diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h index d13fb12455c..4bd980952f1 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());