vector (std::__debug::vector<>::clear()): Do not reset guaranteed capacity.
authorFrançois Dumont <fdumont@gcc.gnu.org>
Sat, 20 Dec 2014 19:16:03 +0000 (19:16 +0000)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Sat, 20 Dec 2014 19:16:03 +0000 (19:16 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/debug/vector
libstdc++-v3/testsuite/23_containers/vector/bool/allocator/swap.cc

index f07255f5593d96758fdfa22db9313f37ad0f45ab..60c90f753a955bb712e4049c9a770b81e45b9756 100644 (file)
@@ -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
index f92a77fed112307639cf0b98ea7773dc0d34e886..174dd7a99fc55cfe28e75b72f376060dc9a1396f 100644 (file)
@@ -669,7 +669,6 @@ namespace __debug
       {
        _Base::clear();
        this->_M_invalidate_all();
-       this->_M_guaranteed_capacity = 0;
       }
 
       _Base&
index cedb24f5ab28a4800f334aee334985153cdf168c..334b955decfba3a7f5f4a3c28f55eb9ab7a52a23 100644 (file)
 
 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;