aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-11-13 13:38:45 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2024-11-13 17:58:50 +0000
commit8586e16154f17df56ba6008c2ffe104bd03dd698 (patch)
tree17c87c80465d52e988b51e821d5afd3ed376e7d7
parent42def7cd8bab71002d3097b9db33fd1dc25a72f6 (diff)
downloadgcc-8586e16154f17df56ba6008c2ffe104bd03dd698.zip
gcc-8586e16154f17df56ba6008c2ffe104bd03dd698.tar.gz
gcc-8586e16154f17df56ba6008c2ffe104bd03dd698.tar.bz2
libstdc++: Stop using std::unary_function in perf tests
This fixes some -Wdeprecated-declarations warnings. libstdc++-v3/ChangeLog: * testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc: Replace std::unary_function with result_type and argument_type typedefs. * testsuite/util/performance/assoc/multimap_common_type.hpp: Likewise.
-rw-r--r--libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc5
-rw-r--r--libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc
index d011e75..e2337a2 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/hash_int_erase_mem.cc
@@ -45,8 +45,11 @@
#include <vector>
#include <functional>
-struct int_hash : public std::unary_function<int, int>
+struct int_hash
{
+ typedef int result_type;
+ typedef int argument_type;
+
inline int
operator()(int i) const
{ return i; }
diff --git a/libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp b/libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp
index 3a38be4..8186042 100644
--- a/libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp
+++ b/libstdc++-v3/testsuite/util/performance/assoc/multimap_common_type.hpp
@@ -46,8 +46,11 @@ namespace __gnu_pbds
{
namespace detail
{
- struct int_hash : public std::unary_function<int, size_t>
+ struct int_hash
{
+ typedef size_t result_type;
+ typedef int argument_type;
+
inline size_t
operator()(const int i) const
{ return (static_cast<size_t>(i)); }