From 2eff2a3cb521c58212885a3dca638764285b5691 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 9 Aug 2021 11:36:07 +0100 Subject: [PATCH] libstdc++: Make allocator equality comparable in tests libstdc++-v3/ChangeLog: * testsuite/23_containers/unordered_map/cons/default.cc: Add equality comparison operators to allocator. * testsuite/23_containers/unordered_set/cons/default.cc: Likewise. --- .../testsuite/23_containers/unordered_map/cons/default.cc | 3 +++ .../testsuite/23_containers/unordered_set/cons/default.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/default.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/default.cc index d64d078a7da..7a785e980b1 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/default.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/default.cc @@ -18,6 +18,9 @@ template void deallocate(T *p, std::size_t n) { std::allocator().deallocate(p, n); } + + bool operator==(const NoDefaultConsAlloc&) const { return true; } + bool operator!=(const NoDefaultConsAlloc&) const { return false; } }; using Map = std::unordered_map, std::equal_to, diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/default.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/default.cc index 41281d3d774..fb87c96ce9d 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/default.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/default.cc @@ -18,6 +18,9 @@ template void deallocate(T *p, std::size_t n) { std::allocator().deallocate(p, n); } + + bool operator==(const NoDefaultConsAlloc&) const { return true; } + bool operator!=(const NoDefaultConsAlloc&) const { return false; } }; using Set = std::unordered_set, std::equal_to,