stl_list.h (_List_node<>::_List_node<>(_Args&&...)): Add in C++0x mode.
2008-10-14 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/stl_list.h (_List_node<>::_List_node<>(_Args&&...)): Add in C++0x mode. (list<>::_M_create_node<>(_Args&&...)): Use _M_get_Node_allocator. (list<>::_M_erase(iterator): Likewise, in C++0x mode. * include/bits/list.tcc (_List_base<>::_M_clear): Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r141113
This commit is contained in:
parent
9c88061824
commit
c841843f9e
@ -1,3 +1,19 @@
|
||||
2008-10-14 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/stl_list.h (_List_node<>::_List_node<>(_Args&&...)):
|
||||
Add in C++0x mode.
|
||||
(list<>::_M_create_node<>(_Args&&...)): Use _M_get_Node_allocator.
|
||||
(list<>::_M_erase(iterator): Likewise, in C++0x mode.
|
||||
* include/bits/list.tcc (_List_base<>::_M_clear): Likewise.
|
||||
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
|
||||
Adjust dg-error line number.
|
||||
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
|
||||
Likewise.
|
||||
* testsuite/23_containers/list/requirements/dr438/
|
||||
constructor_1_neg.cc: Likewise.
|
||||
* testsuite/23_containers/list/requirements/dr438/
|
||||
constructor_2_neg.cc: Likewise.
|
||||
|
||||
2008-10-14 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/stl_tree.h (_Rb_tree<>::max_size): Use Node_allocator
|
||||
|
@ -1,6 +1,6 @@
|
||||
// List implementation (out of line) -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
@ -75,7 +75,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
|
||||
{
|
||||
_Node* __tmp = __cur;
|
||||
__cur = static_cast<_Node*>(__cur->_M_next);
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
_M_get_Node_allocator().destroy(__tmp);
|
||||
#else
|
||||
_M_get_Tp_allocator().destroy(&__tmp->_M_data);
|
||||
#endif
|
||||
_M_put_node(__tmp);
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +101,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
|
||||
{
|
||||
///< User's data.
|
||||
_Tp _M_data;
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
template<typename... _Args>
|
||||
_List_node(_Args&&... __args)
|
||||
: _List_node_base(), _M_data(std::forward<_Args>(__args)...) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@ -478,8 +484,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
|
||||
_Node* __p = this->_M_get_node();
|
||||
try
|
||||
{
|
||||
_M_get_Tp_allocator().construct(&__p->_M_data,
|
||||
std::forward<_Args>(__args)...);
|
||||
_M_get_Node_allocator().construct(__p,
|
||||
std::forward<_Args>(__args)...);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -1423,7 +1429,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
|
||||
{
|
||||
__position._M_node->unhook();
|
||||
_Node* __n = static_cast<_Node*>(__position._M_node);
|
||||
_M_get_Tp_allocator().destroy(&__n->_M_data);
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
_M_get_Node_allocator().destroy(__n);
|
||||
#else
|
||||
_M_get_Tp_allocator().destroy(&__n->_M_data);
|
||||
#endif
|
||||
_M_put_node(__n);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
// USA.
|
||||
|
||||
// { dg-do compile }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1383 }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1389 }
|
||||
// { dg-excess-errors "" }
|
||||
|
||||
#include <list>
|
||||
|
@ -19,7 +19,7 @@
|
||||
// USA.
|
||||
|
||||
// { dg-do compile }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1352 }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1358 }
|
||||
// { dg-excess-errors "" }
|
||||
|
||||
#include <list>
|
||||
|
@ -19,7 +19,7 @@
|
||||
// USA.
|
||||
|
||||
// { dg-do compile }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1352 }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1358 }
|
||||
// { dg-excess-errors "" }
|
||||
|
||||
#include <list>
|
||||
|
@ -19,7 +19,7 @@
|
||||
// USA.
|
||||
|
||||
// { dg-do compile }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1352 }
|
||||
// { dg-error "no matching" "" { target *-*-* } 1358 }
|
||||
// { dg-excess-errors "" }
|
||||
|
||||
#include <list>
|
||||
|
Loading…
Reference in New Issue
Block a user