From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 912523858436; Tue, 28 Sep 2021 19:24:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 912523858436 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-3937] libstdc++: Fix tests that use invalid types in ordered containers X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 45a8cd256934be3770f7e000db7b13f10eabee9a X-Git-Newrev: 4000d722e609bbbb1e923721b54911bb784eeec3 Message-Id: <20210928192441.912523858436@sourceware.org> Date: Tue, 28 Sep 2021 19:24:41 +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: Tue, 28 Sep 2021 19:24:41 -0000 https://gcc.gnu.org/g:4000d722e609bbbb1e923721b54911bb784eeec3 commit r12-3937-g4000d722e609bbbb1e923721b54911bb784eeec3 Author: Jonathan Wakely Date: Fri Sep 24 13:21:34 2021 +0100 libstdc++: Fix tests that use invalid types in ordered containers Types used in ordered containers need to be comparable, or the container needs to use a custom comparison function. These tests fail when _GLIBCXX_CONCEPT_CHECKS is defined, because the element types aren't comparable. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/20_util/is_nothrow_swappable/value.h: Use custom comparison function for priority_queue of type with no relational operators. * testsuite/20_util/is_swappable/value.h: Likewise. * testsuite/24_iterators/output/concept.cc: Add operator< to type used in set. Diff: --- libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.h | 4 +++- libstdc++-v3/testsuite/20_util/is_swappable/value.h | 11 ++++++++++- libstdc++-v3/testsuite/24_iterators/output/concept.cc | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.h b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.h index 62b3db8dc1f..d6f166bee46 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.h +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.h @@ -285,7 +285,9 @@ void test01() static_assert(test_property>(true), ""); static_assert(test_property>(true), ""); + std::priority_queue, + comps::CompareNoThrowCopyable>>(true), ""); static_assert(test_property>(true), ""); static_assert(test_property + bool operator()(const T&, const T&) const + { return false; } + }; } void test01() { @@ -152,7 +159,9 @@ void test01() static_assert(test_property[1][2][3]>(true), ""); static_assert(test_property>(true), ""); + std::priority_queue, + funny::DummyCmp>>(true), ""); static_assert(test_property>(true), ""); static_assert(test_property::iterator, int > ); static_assert( output_iterator< array::iterator, B > );