[PATCH] D11576: Fix a problem in inplace_merge, where we leave objects in a moved-from state.

Eric Fiselier eric at efcs.ca
Tue Jul 28 14:43:06 PDT 2015


EricWF added a comment.

Adding review comments. LGTM after addressing the comments.


================
Comment at: include/algorithm:4365
@@ +4364,3 @@
+template <class _Compare, class _InputIterator1, class _InputIterator2,
+          class _OutputIterator>
+void __half_inplace_merge(_InputIterator1 __first1, _InputIterator1 __last1,
----------------
`_LIBCPP_INLINE_VISIBILITY`

================
Comment at: test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp:23
@@ -22,1 +22,3 @@
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+struct S {
----------------
`TEST_STD_VER >= 11` instead?

================
Comment at: test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp:32
@@ +31,3 @@
+	S& operator =(const S&  rhs) { i_ = rhs.i_;              return *this; }
+	S& operator =(      S&& rhs) { i_ = rhs.i_; rhs.i_ = -2; return *this; }
+	S& operator =(int i)         { i_ = i;                   return *this; }
----------------
Should we assert that no self move-assignment occurs?


http://reviews.llvm.org/D11576







More information about the cfe-commits mailing list