From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Improve types used as iterators in testsuite
Date: Tue, 28 Sep 2021 20:25:56 +0100 [thread overview]
Message-ID: <YVNsRAj8JdCoFrTo@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 280 bytes --]
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* testsuite/25_algorithms/copy/34595.cc: Add missing operation
for type used as an iterator.
* testsuite/25_algorithms/unique_copy/check_type.cc: Likewise.
Tested x86_64-linux. Committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2251 bytes --]
commit 5f1db7627f6eea2050c3d71f17bca5ecf586a813
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Sep 24 13:23:34 2021
libstdc++: Improve types used as iterators in testsuite
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* testsuite/25_algorithms/copy/34595.cc: Add missing operation
for type used as an iterator.
* testsuite/25_algorithms/unique_copy/check_type.cc: Likewise.
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/34595.cc b/libstdc++-v3/testsuite/25_algorithms/copy/34595.cc
index c534eeb17f5..513425a5a2c 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy/34595.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy/34595.cc
@@ -27,11 +27,12 @@ class Counting_output_iterator
public:
Counting_output_iterator() : c(0) {}
Counting_output_iterator& operator++() { return *this; }
+ Counting_output_iterator operator++(int) { return *this; }
Counting_output_iterator& operator*() { return *this; }
-
+
template <typename T>
void operator=(const T&) { ++c; }
-
+
std::size_t current_counter() const { return c; }
};
diff --git a/libstdc++-v3/testsuite/25_algorithms/unique_copy/check_type.cc b/libstdc++-v3/testsuite/25_algorithms/unique_copy/check_type.cc
index af86548609f..27b35794e8a 100644
--- a/libstdc++-v3/testsuite/25_algorithms/unique_copy/check_type.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/unique_copy/check_type.cc
@@ -25,27 +25,35 @@
using __gnu_test::input_iterator_wrapper;
using __gnu_test::output_iterator_wrapper;
-struct S1 { };
+template<typename T>
+struct iter_facade
+{
+ T& operator++();
+ T operator++(int);
+ T& operator*() const;
+};
-struct S2
+struct S1 : iter_facade<S1> { };
+
+struct S2 : iter_facade<S2>
{
S2(const S1&) {}
};
-bool
+bool
operator==(const S1&, const S1&) {return true;}
-struct X1 { };
+struct X1 : iter_facade<X1> { };
-struct X2
+struct X2 : iter_facade<X2>
{
X2(const X1&) {}
};
-bool
+bool
predicate(const X1&, const X1&) {return true;}
-output_iterator_wrapper<S2>
+output_iterator_wrapper<S2>
test1(input_iterator_wrapper<S1>& s1, output_iterator_wrapper<S2>& s2)
{ return std::unique_copy(s1, s1, s2); }
reply other threads:[~2021-09-28 19:26 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=YVNsRAj8JdCoFrTo@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).