From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 639CA385DC33 for ; Mon, 24 May 2021 18:53:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 639CA385DC33 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-b_Z4BIS8Nv6HDENk5RnojQ-1; Mon, 24 May 2021 14:53:40 -0400 X-MC-Unique: b_Z4BIS8Nv6HDENk5RnojQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 741551005D56; Mon, 24 May 2021 18:53:39 +0000 (UTC) Received: from localhost (unknown [10.33.37.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA36E1001281; Mon, 24 May 2021 18:53:38 +0000 (UTC) Date: Mon, 24 May 2021 19:53:38 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Qualify functions used in tests Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="rrcpAgNfL7p4bf16" Content-Disposition: inline X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2021 18:53:45 -0000 --rrcpAgNfL7p4bf16 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline These tests rely on ADL for some functions, probably unintentionally. The calls only work because the iterator wrappers derive from std::iterator and so namespace std is an associated namespace. libstdc++-v3/ChangeLog: * testsuite/25_algorithms/inplace_merge/constrained.cc: Qualify call to ranges::next. * testsuite/25_algorithms/is_sorted/constrained.cc: Likewise. * testsuite/25_algorithms/is_sorted_until/constrained.cc: Likewise. * testsuite/25_algorithms/swap_ranges/1.cc: Qualify call to swap_ranges. Tested powerpc64le-linux. Committed to trunk. --rrcpAgNfL7p4bf16 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 6fdc59f196c3e1b4aeeb8a0407d4eb40645c5251 Author: Jonathan Wakely Date: Mon May 24 18:42:09 2021 libstdc++: Qualify functions used in tests These tests rely on ADL for some functions, probably unintentionally. The calls only work because the iterator wrappers derive from std::iterator and so namespace std is an associated namespace. libstdc++-v3/ChangeLog: * testsuite/25_algorithms/inplace_merge/constrained.cc: Qualify call to ranges::next. * testsuite/25_algorithms/is_sorted/constrained.cc: Likewise. * testsuite/25_algorithms/is_sorted_until/constrained.cc: Likewise. * testsuite/25_algorithms/swap_ranges/1.cc: Qualify call to swap_ranges. diff --git a/libstdc++-v3/testsuite/25_algorithms/inplace_merge/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/inplace_merge/constrained.cc index e1f59bf86b5..2f3d5d6955a 100644 --- a/libstdc++-v3/testsuite/25_algorithms/inplace_merge/constrained.cc +++ b/libstdc++-v3/testsuite/25_algorithms/inplace_merge/constrained.cc @@ -41,7 +41,7 @@ test01() ranges::sort(v); test_range rz(v.data(), v.data()+i+j); - auto result = ranges::inplace_merge(rz, next(ranges::begin(rz), i)); + auto result = ranges::inplace_merge(rz, ranges::next(ranges::begin(rz), i)); VERIFY( result == rz.end() ); VERIFY( ranges::is_sorted(rz) ); diff --git a/libstdc++-v3/testsuite/25_algorithms/is_sorted/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/is_sorted/constrained.cc index c3764846090..92440bb7bd7 100644 --- a/libstdc++-v3/testsuite/25_algorithms/is_sorted/constrained.cc +++ b/libstdc++-v3/testsuite/25_algorithms/is_sorted/constrained.cc @@ -46,7 +46,7 @@ test02() test_range rx(x); VERIFY( ranges::is_sorted(rx) ); VERIFY( !ranges::is_sorted(ranges::begin(rx), - next(ranges::begin(rx), 2), + ranges::next(ranges::begin(rx), 2), ranges::greater{}) ); } diff --git a/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constrained.cc index 9d23ebc81fe..bc323348313 100644 --- a/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constrained.cc +++ b/libstdc++-v3/testsuite/25_algorithms/is_sorted_until/constrained.cc @@ -50,9 +50,9 @@ test02() test_range rx(x); VERIFY( ranges::is_sorted_until(rx) == ranges::end(rx) ); VERIFY( ranges::is_sorted_until(ranges::begin(rx), - next(ranges::begin(rx), 2), + ranges::next(ranges::begin(rx), 2), ranges::greater{}) - == next(ranges::begin(rx), 1) ); + == ranges::next(ranges::begin(rx), 1) ); } constexpr bool diff --git a/libstdc++-v3/testsuite/25_algorithms/swap_ranges/1.cc b/libstdc++-v3/testsuite/25_algorithms/swap_ranges/1.cc index 31eee31cd6d..4660199af50 100644 --- a/libstdc++-v3/testsuite/25_algorithms/swap_ranges/1.cc +++ b/libstdc++-v3/testsuite/25_algorithms/swap_ranges/1.cc @@ -24,7 +24,7 @@ using __gnu_test::test_container; using __gnu_test::forward_iterator_wrapper; -typedef test_container Container; +typedef test_container Container; void @@ -46,10 +46,10 @@ test2() int array2[] = {1}; Container con1(array1, array1); Container con2(array2, array2); - VERIFY(swap_ranges(con1.begin(), con1.end(), con2.begin()).ptr == array2); + VERIFY(std::swap_ranges(con1.begin(), con1.end(), con2.begin()).ptr == array2); } -int +int main() { test1(); --rrcpAgNfL7p4bf16--