[gcc r14-11356] libstdc++: Add missing equality comparison in new tests [PR117921]
Jonathan Wakely
redi@gcc.gnu.org
Fri Feb 28 15:28:31 GMT 2025
https://gcc.gnu.org/g:6e97d601f18141a67d0896122187e556d5f3d6c4
commit r14-11356-g6e97d601f18141a67d0896122187e556d5f3d6c4
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Dec 9 09:36:15 2024 +0000
libstdc++: Add missing equality comparison in new tests [PR117921]
These new tests fail in Debug Mode because the allocator types aren't
equality comparable.
libstdc++-v3/ChangeLog:
PR libstdc++/117921
* testsuite/23_containers/set/modifiers/swap/adl.cc: Add
equality comparison for Allocator.
* testsuite/23_containers/unordered_set/modifiers/swap-2.cc:
Likewise.
(cherry picked from commit 5cdd78b39725fb1d82cb6bd68e8f56bf4f5d51cd)
Diff:
---
libstdc++-v3/testsuite/23_containers/set/modifiers/swap/adl.cc | 1 +
libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap-2.cc | 1 +
2 files changed, 2 insertions(+)
diff --git a/libstdc++-v3/testsuite/23_containers/set/modifiers/swap/adl.cc b/libstdc++-v3/testsuite/23_containers/set/modifiers/swap/adl.cc
index 2b7975a366fc..e2a1742c953a 100644
--- a/libstdc++-v3/testsuite/23_containers/set/modifiers/swap/adl.cc
+++ b/libstdc++-v3/testsuite/23_containers/set/modifiers/swap/adl.cc
@@ -36,6 +36,7 @@ namespace adl
using propagate_on_container_swap = std::true_type;
friend void swap(Allocator&, Allocator&) { swapped = true; }
+ friend bool operator==(Allocator, Allocator) { return true; }
};
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap-2.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap-2.cc
index a0fb1a6f662f..9d8b2200e24c 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap-2.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap-2.cc
@@ -43,6 +43,7 @@ namespace adl
using propagate_on_container_swap = std::true_type;
friend void swap(Allocator&, Allocator&) { swapped = true; }
+ friend bool operator==(Allocator, Allocator) { return true; }
};
}
More information about the Libstdc++-cvs
mailing list