From: Jonathan Wakely Date: Fri, 14 Jun 2019 18:11:26 +0000 (+0100) Subject: Remove redundant step in experimental::filesystem::path construction X-Git-Tag: releases/gcc-9.2.0~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16af62ebdbf7aa31b53a21d51a12cbc0a6a30402;p=thirdparty%2Fgcc.git Remove redundant step in experimental::filesystem::path construction Backport from mainline 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. From-SVN: r272305 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 78694e69b1e8..1f503c40fe89 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2019-06-14 Jonathan Wakely + + Backport from mainline + 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. + 2019-06-14 Jonathan Wakely Backport from mainline diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index ff12b3ca0724..647fb4db2828 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -485,7 +485,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); }