vector (std::__debug::vector<>::clear()): Do not reset guaranteed capacity.
2014-12-20 François Dumont <fdumont@gcc.gnu.org> * include/debug/vector (std::__debug::vector<>::clear()): Do not reset guaranteed capacity. * testsuite/23_containers/vector/bool/allocator/swap.cc: Move propagating_allocator equality and inequality operators to __gnu_test namespace. From-SVN: r218991
This commit is contained in:
parent
aa1986fac1
commit
a5ebfd3e2a
@ -1,5 +1,11 @@
|
|||||||
2014-12-20 François Dumont <fdumont@gcc.gnu.org>
|
2014-12-20 François Dumont <fdumont@gcc.gnu.org>
|
||||||
|
|
||||||
|
* include/debug/vector (std::__debug::vector<>::clear()): Do not reset
|
||||||
|
guaranteed capacity.
|
||||||
|
* testsuite/23_containers/vector/bool/allocator/swap.cc: Move
|
||||||
|
propagating_allocator equality and inequality operators to __gnu_test
|
||||||
|
namespace.
|
||||||
|
|
||||||
* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error.
|
* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error.
|
||||||
|
|
||||||
* include/bits/c++config: inline __cxx11 namespace within namespace
|
* include/bits/c++config: inline __cxx11 namespace within namespace
|
||||||
|
@ -669,7 +669,6 @@ namespace __debug
|
|||||||
{
|
{
|
||||||
_Base::clear();
|
_Base::clear();
|
||||||
this->_M_invalidate_all();
|
this->_M_invalidate_all();
|
||||||
this->_M_guaranteed_capacity = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_Base&
|
_Base&
|
||||||
|
@ -23,24 +23,27 @@
|
|||||||
|
|
||||||
using T = bool;
|
using T = bool;
|
||||||
|
|
||||||
using __gnu_test::propagating_allocator;
|
namespace __gnu_test
|
||||||
|
|
||||||
// It is undefined behaviour to swap() containers wth unequal allocators
|
|
||||||
// if the allocator doesn't propagate, so ensure the allocators compare
|
|
||||||
// equal, while still being able to test propagation via get_personality().
|
|
||||||
bool
|
|
||||||
operator==(const propagating_allocator<T, false>&,
|
|
||||||
const propagating_allocator<T, false>&)
|
|
||||||
{
|
{
|
||||||
|
// It is undefined behaviour to swap() containers with unequal allocators
|
||||||
|
// if the allocator doesn't propagate, so ensure the allocators compare
|
||||||
|
// equal, while still being able to test propagation via get_personality().
|
||||||
|
bool
|
||||||
|
operator==(const propagating_allocator<T, false>&,
|
||||||
|
const propagating_allocator<T, false>&)
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
operator!=(const propagating_allocator<T, false>&,
|
||||||
|
const propagating_allocator<T, false>&)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
using __gnu_test::propagating_allocator;
|
||||||
operator!=(const propagating_allocator<T, false>&,
|
|
||||||
const propagating_allocator<T, false>&)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void test01()
|
void test01()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user