aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-06-06 20:39:27 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-06-06 20:39:27 +0100
commit9d67f13e6afe013a65c1e910bf8fdda976dcd1ad (patch)
tree9a789e102abe648036e729260e0e86ee969494eb
parentec74725ce3ed5c96783b76992940d99563c82a47 (diff)
downloadgcc-9d67f13e6afe013a65c1e910bf8fdda976dcd1ad.zip
gcc-9d67f13e6afe013a65c1e910bf8fdda976dcd1ad.tar.gz
gcc-9d67f13e6afe013a65c1e910bf8fdda976dcd1ad.tar.bz2
Remove redundant std::move on const object
* include/bits/shared_ptr_base.h (__shared_count): Remove redundant move of const value. From-SVN: r261245
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index de40fb4..24d1849 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-06 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/shared_ptr_base.h (__shared_count): Remove redundant
+ move of const value.
+
2018-06-06 Jakub Jelinek <jakub@redhat.com>
PR c++/86068
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index 6c5089a..887edbd 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -534,6 +534,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
public:
using __allocator_type = __alloc_rebind<_Alloc, _Sp_counted_ptr_inplace>;
+ // Alloc parameter is not a reference so doesn't alias anything in __args
template<typename... _Args>
_Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
: _M_impl(__a)
@@ -653,8 +654,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename _Sp_cp_type::__allocator_type __a2(__a);
auto __guard = std::__allocate_guarded(__a2);
_Sp_cp_type* __mem = __guard.get();
- ::new (__mem) _Sp_cp_type(std::move(__a),
- std::forward<_Args>(__args)...);
+ ::new (__mem) _Sp_cp_type(__a, std::forward<_Args>(__args)...);
_M_pi = __mem;
__guard = nullptr;
}