diff options
author | François Dumont <fdumont@gcc.gnu.org> | 2014-12-20 19:16:03 +0000 |
---|---|---|
committer | François Dumont <fdumont@gcc.gnu.org> | 2014-12-20 19:16:03 +0000 |
commit | a5ebfd3e2ad8b429165afb90ffe0a91fe790ff2c (patch) | |
tree | 2a7acf49f26ae509a6178692edc32933cfb7060e | |
parent | aa1986fac1b9bc0124b935fcaa80aa9252996c09 (diff) | |
download | gcc-a5ebfd3e2ad8b429165afb90ffe0a91fe790ff2c.zip gcc-a5ebfd3e2ad8b429165afb90ffe0a91fe790ff2c.tar.gz gcc-a5ebfd3e2ad8b429165afb90ffe0a91fe790ff2c.tar.bz2 |
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/vector | 1 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/vector/bool/allocator/swap.cc | 33 |
3 files changed, 24 insertions, 16 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f07255f..60c90f7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,11 @@ 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. * include/bits/c++config: inline __cxx11 namespace within namespace diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index f92a77f..174dd7a 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -669,7 +669,6 @@ namespace __debug { _Base::clear(); this->_M_invalidate_all(); - this->_M_guaranteed_capacity = 0; } _Base& diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/allocator/swap.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/allocator/swap.cc index cedb24f..334b955 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/bool/allocator/swap.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/bool/allocator/swap.cc @@ -23,25 +23,28 @@ using T = bool; -using __gnu_test::propagating_allocator; - -// 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>&) +namespace __gnu_test { - return true; -} + // 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; + } -bool -operator!=(const propagating_allocator<T, false>&, - const propagating_allocator<T, false>&) -{ - return false; + bool + operator!=(const propagating_allocator<T, false>&, + const propagating_allocator<T, false>&) + { + return false; + } } +using __gnu_test::propagating_allocator; + void test01() { bool test __attribute__((unused)) = true; |