+2014-08-07 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/stl_list.h (_List_base::_List_base(_List_base&&)):
+ Optimize.
+ * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
+ Adjust dg-error line number.
+ * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
+ Likewise.
+ * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
+ Likewise.
+ * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
+ Likewise.
+
2014-08-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/15339
_List_base(_List_base&& __x) noexcept
: _M_impl(std::move(__x._M_get_Node_allocator()))
{
- _M_init();
- __detail::_List_node_base::swap(_M_impl._M_node, __x._M_impl._M_node);
+ auto* const __xnode = std::__addressof(__x._M_impl._M_node);
+ if (__xnode->_M_next == __xnode)
+ _M_init();
+ else
+ {
+ auto* const __node = std::__addressof(_M_impl._M_node);
+ __node->_M_next = __xnode->_M_next;
+ __node->_M_prev = __xnode->_M_prev;
+ __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
+ __xnode->_M_next = __xnode->_M_prev = __xnode;
+ }
}
#endif
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1656 }
+// { dg-error "no matching" "" { target *-*-* } 1665 }
#include <list>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1608 }
+// { dg-error "no matching" "" { target *-*-* } 1617 }
#include <list>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1608 }
+// { dg-error "no matching" "" { target *-*-* } 1617 }
#include <list>
#include <utility>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1608 }
+// { dg-error "no matching" "" { target *-*-* } 1617 }
#include <list>