From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 8411C385B833; Wed, 2 Feb 2022 17:37:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8411C385B833 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-7004] libstdc++: Fix invalid instantiations in tests X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: b229c5186093fa6603030ae83d5fe640ef7051a4 X-Git-Newrev: c123096cf14ac87875bba51279e46cceeb18faa1 Message-Id: <20220202173719.8411C385B833@sourceware.org> Date: Wed, 2 Feb 2022 17:37:19 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2022 17:37:19 -0000 https://gcc.gnu.org/g:c123096cf14ac87875bba51279e46cceeb18faa1 commit r12-7004-gc123096cf14ac87875bba51279e46cceeb18faa1 Author: Jonathan Wakely 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> ); + struct Cmp + { + bool operator()(E, E) const { return false; } + }; + static_assert( ! std::totally_ordered> ); static_assert( ! std::three_way_comparable ); - static_assert( ! std::three_way_comparable> ); + static_assert( ! std::three_way_comparable> ); } 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> ); + struct Cmp + { + bool operator()(E, E) const { return false; } + }; + static_assert( ! std::totally_ordered> ); static_assert( ! std::three_way_comparable ); - static_assert( ! std::three_way_comparable> ); + static_assert( ! std::three_way_comparable> ); } void