diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-07 17:25:13 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-07 17:25:13 +0000 |
commit | 1ddba39def778fde84cf19e926257412818fbacd (patch) | |
tree | e4577867de9b616e237e4fa05632d92b72a3e461 | |
parent | 6664d308fc2db94ef8804937b86f57dc65711ac1 (diff) | |
download | gcc-1ddba39def778fde84cf19e926257412818fbacd.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213716 138bc75d-0d04-0410-961f-82ee72b054a4
6 files changed, 28 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 15422ae9713..6dfddd052f5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +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 diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index e014fbcd3ce..dd9bba73bc1 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -377,8 +377,17 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _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 diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc index 7c29a2d8c9b..885e7534546 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1656 } +// { dg-error "no matching" "" { target *-*-* } 1665 } #include <list> diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc index 382d985c1b0..ccd9d1734bf 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1608 } +// { dg-error "no matching" "" { target *-*-* } 1617 } #include <list> diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc index 14585af98fa..04966dc443a 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1608 } +// { dg-error "no matching" "" { target *-*-* } 1617 } #include <list> #include <utility> diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc index a9f9f305f27..759dad6dba7 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1608 } +// { dg-error "no matching" "" { target *-*-* } 1617 } #include <list> |