public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-9304] libstdc++: Make allocator equality comparable in tests Date: Wed, 24 Nov 2021 11:52:35 +0000 (GMT) [thread overview] Message-ID: <20211124115235.24C6C385780A@sourceware.org> (raw) https://gcc.gnu.org/g:5644702ef9b08dd5a4f77ffd9b41116586d25994 commit r11-9304-g5644702ef9b08dd5a4f77ffd9b41116586d25994 Author: Jonathan Wakely <jwakely@redhat.com> Date: Mon Aug 9 11:36:07 2021 +0100 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. (cherry picked from commit 2eff2a3cb521c58212885a3dca638764285b5691) Diff: --- libstdc++-v3/testsuite/23_containers/unordered_map/cons/default.cc | 3 +++ libstdc++-v3/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<typename T> void deallocate(T *p, std::size_t n) { std::allocator<T>().deallocate(p, n); } + + bool operator==(const NoDefaultConsAlloc&) const { return true; } + bool operator!=(const NoDefaultConsAlloc&) const { return false; } }; using Map = std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, 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<typename T> void deallocate(T *p, std::size_t n) { std::allocator<T>().deallocate(p, n); } + + bool operator==(const NoDefaultConsAlloc&) const { return true; } + bool operator!=(const NoDefaultConsAlloc&) const { return false; } }; using Set = std::unordered_set<int, std::hash<int>, std::equal_to<int>,
reply other threads:[~2021-11-24 11:52 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211124115235.24C6C385780A@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).