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 r12-7004] libstdc++: Fix invalid instantiations in tests Date: Wed, 2 Feb 2022 17:37:19 +0000 (GMT) [thread overview] Message-ID: <20220202173719.8411C385B833@sourceware.org> (raw) https://gcc.gnu.org/g:c123096cf14ac87875bba51279e46cceeb18faa1 commit r12-7004-gc123096cf14ac87875bba51279e46cceeb18faa1 Author: Jonathan Wakely <jwakely@redhat.com> Date: Wed Feb 2 17:04:58 2022 +0000 libstdc++: Fix invalid instantiations in tests These tests instantiate std::multiset and std::set with a type that has no operator< so they should use a custom comparison function. libstdc++-v3/ChangeLog: * testsuite/23_containers/multiset/operators/cmp_c++20.cc: Use custom comparison function for multiset. * testsuite/23_containers/set/operators/cmp_c++20.cc: Use custom comparison function for set. Diff: --- .../testsuite/23_containers/multiset/operators/cmp_c++20.cc | 8 ++++++-- libstdc++-v3/testsuite/23_containers/set/operators/cmp_c++20.cc | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/testsuite/23_containers/multiset/operators/cmp_c++20.cc b/libstdc++-v3/testsuite/23_containers/multiset/operators/cmp_c++20.cc index 3972f756af9..ad3ab787946 100644 --- a/libstdc++-v3/testsuite/23_containers/multiset/operators/cmp_c++20.cc +++ b/libstdc++-v3/testsuite/23_containers/multiset/operators/cmp_c++20.cc @@ -49,9 +49,13 @@ test01() { bool operator==(E) { return true; } }; - static_assert( ! std::totally_ordered<std::multiset<E>> ); + struct Cmp + { + bool operator()(E, E) const { return false; } + }; + static_assert( ! std::totally_ordered<std::multiset<E, Cmp>> ); static_assert( ! std::three_way_comparable<E> ); - static_assert( ! std::three_way_comparable<std::multiset<E>> ); + static_assert( ! std::three_way_comparable<std::multiset<E, Cmp>> ); } void diff --git a/libstdc++-v3/testsuite/23_containers/set/operators/cmp_c++20.cc b/libstdc++-v3/testsuite/23_containers/set/operators/cmp_c++20.cc index fdcb5db699d..58698bf426f 100644 --- a/libstdc++-v3/testsuite/23_containers/set/operators/cmp_c++20.cc +++ b/libstdc++-v3/testsuite/23_containers/set/operators/cmp_c++20.cc @@ -49,9 +49,13 @@ test01() { bool operator==(E) { return true; } }; - static_assert( ! std::totally_ordered<std::set<E>> ); + struct Cmp + { + bool operator()(E, E) const { return false; } + }; + static_assert( ! std::totally_ordered<std::set<E, Cmp>> ); static_assert( ! std::three_way_comparable<E> ); - static_assert( ! std::three_way_comparable<std::set<E>> ); + static_assert( ! std::three_way_comparable<std::set<E, Cmp>> ); } void
reply other threads:[~2022-02-02 17:37 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=20220202173719.8411C385B833@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).