[gcc/devel/omp/gcc-9] Remove redundant step in experimental::filesystem::path construction
Tobias Burnus
burnus@gcc.gnu.org
Thu Mar 5 13:59:00 GMT 2020
https://gcc.gnu.org/g:16af62ebdbf7aa31b53a21d51a12cbc0a6a30402
commit 16af62ebdbf7aa31b53a21d51a12cbc0a6a30402
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Jun 14 19:11:26 2019 +0100
Remove redundant step in experimental::filesystem::path construction
Backport from mainline
2019-04-26 Jonathan Wakely <jwakely@redhat.com>
* 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:
---
libstdc++-v3/ChangeLog | 9 +++++++++
libstdc++-v3/include/experimental/bits/fs_path.h | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 78694e6..1f503c4 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,6 +1,15 @@
2019-06-14 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
+ 2019-04-26 Jonathan Wakely <jwakely@redhat.com>
+
+ * 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 <jwakely@redhat.com>
+
+ Backport from mainline
2019-05-29 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/88881
diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h
index ff12b3c..647fb4d 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);
}
More information about the Libstdc++-cvs
mailing list