From: redi Date: Fri, 26 Apr 2019 15:58:47 +0000 (+0000) Subject: Remove redundant step in experimental::filesystem::path construction X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c259ff88b3a47aa7a5084e1ffe55ad7a62393b6;p=thirdparty%2Fgcc.git Remove redundant step in experimental::filesystem::path construction * include/experimental/bits/fs_path.h (path::_S_convert_loc<_InputIterator>): Create const std::string to avoid redundant call to _S_convert_loc with non-const pointers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270608 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 78626838d4ff..0f679e3fd892 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2019-04-26 Jonathan Wakely + * include/experimental/bits/fs_path.h + (path::_S_convert_loc<_InputIterator>): Create const std::string to + avoid redundant call to _S_convert_loc with non-const pointers. + * testsuite/20_util/variant/run.cc: Use a new Hashable type to test hashing, because pmr::string depends on _GLIBCXX_USE_CXX11_ABI==1. * testsuite/21_strings/basic_string/hash/hash.cc diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index ebd5072fc1ab..c7b22f295690 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -483,7 +483,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _S_convert_loc(_InputIterator __src, __null_terminated, const std::locale& __loc) { - std::string __s = _S_string_from_iter(__src); + const std::string __s = _S_string_from_iter(__src); return _S_convert_loc(__s.data(), __s.data() + __s.size(), __loc); }