]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove unary_function base classes from std::thread tests
authorJonathan Wakely <jwakely@redhat.com>
Mon, 24 May 2021 17:32:22 +0000 (18:32 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 1 Oct 2021 19:36:54 +0000 (20:36 +0100)
std::thread does not care if a function object is adaptable, so there is
no need to derive from the deprecated std::unary_function class in these
tests.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* testsuite/30_threads/thread/cons/3.cc: Remove derivation from
std::unary_function.
* testsuite/30_threads/thread/cons/4.cc: Likewise.
* testsuite/30_threads/thread/cons/5.cc: Likewise.

libstdc++-v3/testsuite/30_threads/thread/cons/3.cc
libstdc++-v3/testsuite/30_threads/thread/cons/4.cc
libstdc++-v3/testsuite/30_threads/thread/cons/5.cc

index efdc631d9507049670d475a6b4fb70253aa28b78..6677156b7f26cf8e5570406aee56034b7c0df96d 100644 (file)
 // <http://www.gnu.org/licenses/>.
 
 
-#include <functional> // std::unary_function, std::ref
+#include <functional> // std::ref
 #include <thread>
 #include <system_error>
 #include <testsuite_hooks.h>
 
-struct copyable : public std::unary_function<std::thread::id&, void>
+struct copyable
 {
   copyable() = default;
   ~copyable() = default;
@@ -84,5 +84,4 @@ void test03()
 int main()
 {
   test03();
-  return 0;
 }
index d74ad9715e336e89012377922ff1523db28fa23e..9508cb45a1ba41bbc34a666b1a39e08304b770e0 100644 (file)
 // <http://www.gnu.org/licenses/>.
 
 
-#include <functional> // std::unary_function, std::ref, std::cref
+#include <functional> // std::ref, std::cref
 #include <thread>
 #include <system_error>
 #include <testsuite_hooks.h>
 
-struct noncopyable : std::unary_function<std::thread::id&, void>
+struct noncopyable
 {
   noncopyable() = default;
   ~noncopyable() = default;
index 74dcd84c0589eabb9c824c716f852ad3a43e3cc3..6d4d6854b300d80fd8f35cfeb92fd81bb6a18868 100644 (file)
 // <http://www.gnu.org/licenses/>.
 
 
-#include <functional> // std::unary_function, std::ref
+#include <functional> // std::ref
 #include <thread>
 #include <system_error>
 #include <testsuite_hooks.h>
 
-struct nonconst : public std::unary_function<std::thread::id&, void>
+struct nonconst
 {
   void operator()(std::thread::id& id)
   {