Fix erasure goofs.
authorEdward Smith-Rowland <3dw4rd@verizon.net>
Thu, 29 Nov 2018 13:43:55 +0000 (13:43 +0000)
committerEdward Smith-Rowland <emsr@gcc.gnu.org>
Thu, 29 Nov 2018 13:43:55 +0000 (13:43 +0000)
2018-11-29  Edward Smith-Rowland  <3dw4rd@verizon.net>

Fix erasure goofs.
* include/experimental/deque: Make inline.
* include/std/deque: Include bits/stl_algo.h.
(erase, erase_if): Make inline.
* include/std/string: Include bits/stl_algo.h.
* include/std/unordered_set: Add erase, erase_if!
* include/std/vector: Include bits/stl_algo.h.
* testsuite/21_strings/basic_string/erasure.cc:
Add { dg-options "-std=gnu++2a" }.
* testsuite/23_containers/deque/erasure.cc: Ditto.
* testsuite/23_containers/forward_list/erasure.cc: Ditto.
* testsuite/23_containers/list/erasure.cc: Ditto.
* testsuite/23_containers/map/erasure.cc: Ditto.
* testsuite/23_containers/set/erasure.cc: Ditto.
* testsuite/23_containers/unordered_map/erasure.cc: Ditto.
* testsuite/23_containers/unordered_set/erasure.cc: Ditto.
* testsuite/23_containers/vector/erasure.cc: Ditto.

From-SVN: r266616

15 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/deque
libstdc++-v3/include/std/deque
libstdc++-v3/include/std/string
libstdc++-v3/include/std/unordered_set
libstdc++-v3/include/std/vector
libstdc++-v3/testsuite/21_strings/basic_string/erasure.cc
libstdc++-v3/testsuite/23_containers/deque/erasure.cc
libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc
libstdc++-v3/testsuite/23_containers/list/erasure.cc
libstdc++-v3/testsuite/23_containers/map/erasure.cc
libstdc++-v3/testsuite/23_containers/set/erasure.cc
libstdc++-v3/testsuite/23_containers/unordered_map/erasure.cc
libstdc++-v3/testsuite/23_containers/unordered_set/erasure.cc
libstdc++-v3/testsuite/23_containers/vector/erasure.cc

index 553be512ec585d291534a1a7236ca1a0e5c57b17..82a6e532f908358e71b055bda38b0d6eff02f9be 100644 (file)
@@ -1,3 +1,23 @@
+2018-11-29  Edward Smith-Rowland  <3dw4rd@verizon.net>
+
+       Fix erasure goofs.
+       * include/experimental/deque: Make inline.
+       * include/std/deque: Include bits/stl_algo.h.
+       (erase, erase_if): Make inline.
+       * include/std/string: Include bits/stl_algo.h.
+       * include/std/unordered_set: Add erase, erase_if!
+       * include/std/vector: Include bits/stl_algo.h.
+       * testsuite/21_strings/basic_string/erasure.cc:
+       Add { dg-options "-std=gnu++2a" }.
+       * testsuite/23_containers/deque/erasure.cc: Ditto.
+       * testsuite/23_containers/forward_list/erasure.cc: Ditto.
+       * testsuite/23_containers/list/erasure.cc: Ditto.
+       * testsuite/23_containers/map/erasure.cc: Ditto.
+       * testsuite/23_containers/set/erasure.cc: Ditto.
+       * testsuite/23_containers/unordered_map/erasure.cc: Ditto.
+       * testsuite/23_containers/unordered_set/erasure.cc: Ditto.
+       * testsuite/23_containers/vector/erasure.cc: Ditto.
+
 2018-11-29  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/88119
index 88790b10936bdfa2313c8a28f7d902b45a59dd2c..e1ea13f4e976e3e99312b933e0209ed95194bd1c 100644 (file)
@@ -46,7 +46,7 @@ namespace experimental
 inline namespace fundamentals_v2
 {
   template<typename _Tp, typename _Alloc, typename _Predicate>
-    void
+    inline void
     erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
     {
       __cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
@@ -54,7 +54,7 @@ inline namespace fundamentals_v2
     }
 
   template<typename _Tp, typename _Alloc, typename _Up>
-    void
+    inline void
     erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
     {
       __cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
index c577e806513e0e638e9621f8ce919bc510b11132..764e1f17948f6f72b124d8d98d39c7e3fe0907b1 100644 (file)
@@ -58,6 +58,7 @@
 #pragma GCC system_header
 
 #include <bits/stl_algobase.h>
+#include <bits/stl_algo.h> // For remove and remove_if
 #include <bits/allocator.h>
 #include <bits/stl_construct.h>
 #include <bits/stl_uninitialized.h>
@@ -92,7 +93,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp, typename _Alloc, typename _Predicate>
-    void
+    inline void
     erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
     {
       __cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
@@ -100,7 +101,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   template<typename _Tp, typename _Alloc, typename _Up>
-    void
+    inline void
     erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
     {
       __cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
index e1497bd21415fb3c39f90a3e053d05c4b060e243..33cb5e6738c76e90ba0aa7ce6325e22edf46e137 100644 (file)
 #include <bits/stl_function.h> // For less
 #include <ext/numeric_traits.h>
 #include <bits/stl_algobase.h>
+#include <bits/stl_algo.h> // For remove and remove_if
 #include <bits/range_access.h>
 #include <bits/basic_string.h>
 #include <bits/basic_string.tcc>
-#include <algorithm> // For remove and remove_if
 
 #if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
 namespace std _GLIBCXX_VISIBILITY(default)
index 310827528a6c028f3d753c2a4dbe1f61391a2c76..a5e1e41815b88d164aaede991418279e9e92031a 100644 (file)
@@ -82,6 +82,19 @@ _GLIBCXX_END_NAMESPACE_VERSION
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
+  template<typename _Key, typename _Hash, typename _CPred, typename _Alloc,
+          typename _Predicate>
+    inline void
+    erase_if(unordered_set<_Key, _Hash, _CPred, _Alloc>& __cont,
+            _Predicate __pred)
+    { std::__detail::__erase_nodes_if(__cont, __pred); }
+
+  template<typename _Key, typename _Hash, typename _CPred, typename _Alloc,
+          typename _Predicate>
+    inline void
+    erase_if(unordered_multiset<_Key, _Hash, _CPred, _Alloc>& __cont,
+            _Predicate __pred)
+    { std::__detail::__erase_nodes_if(__cont, __pred); }
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
 #endif // C++20
index 5a1edaf9d74d17bf7570fe3fd75d1419b1348a33..720e0eb9cc3e79a46734af4dcde8a2b38c15bcce 100644 (file)
@@ -58,6 +58,7 @@
 #pragma GCC system_header
 
 #include <bits/stl_algobase.h>
+#include <bits/stl_algo.h> // For remove and remove_if
 #include <bits/allocator.h>
 #include <bits/stl_construct.h>
 #include <bits/stl_uninitialized.h>
index e9cca6f41584bc4400e6d30a3e881fef9b002333..d8ac6a45297ac1a3f5f7fae132dfe27b73cd4d30 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
index 1fe6273c98442bdfc5f8c045f6e9d2cbbde92d4b..1bb0b95d200845dd257a5c6a14b9a0d36542a8a6 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
index ac8a37d19d6caf6c41353b4379c654a5480ff71c..9d06ebe37e4f39402542c207b06ceb2d45fa270e 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
index c8d6f2212cc067ac1a8b0645f0a7266a4374ba19..ff4dbcf778bee73a7d7cde40b8a172d3506104bc 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
index d638715e75a8599d9218ae4ee0d5110bd861aa60..58706a1be01ed97daaf9541f13bb34503fa6771d 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
index 54b821b145dc7b5aff8c1401d4d8b6d7d499f462..1dccde8147ecad1e93cc66970557d8ae7ba43219 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
index 0e17b4e2be21ba879b981c26932400524f3ed1e9..8a475482802d6d128b511273dac1f950601be94b 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
index 5d32c3235c3509ca13abda48556a532241cc4835..e5fcde00c0163b86a663605b02b1bb1e2cf60d8a 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
index b050b5422e8411c263cf4647a99ae66f656fbe2c..57567d3338a25dd6f81ad7a4ff85969f18593c59 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.