From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Qualify functions used in tests
Date: Mon, 24 May 2021 19:53:38 +0100 [thread overview]
Message-ID: <YKv2MpMOefTGaL8v@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 565 bytes --]
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.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 3650 bytes --]
commit 6fdc59f196c3e1b4aeeb8a0407d4eb40645c5251
Author: Jonathan Wakely <jwakely@redhat.com>
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<int, bidirectional_iterator_wrapper> 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<int, forward_iterator_wrapper> 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<int, forward_iterator_wrapper> 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<int, forward_iterator_wrapper> Container;
+typedef test_container<int, forward_iterator_wrapper> 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();
reply other threads:[~2021-05-24 18:53 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=YKv2MpMOefTGaL8v@redhat.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@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: link
Be 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).