summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc')
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc
index a05948a49c6..91f742dca76 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy/constrained.cc
@@ -226,6 +226,29 @@ test06()
VERIFY( ranges::equal(v, (int[]){1,2,3,0}) );
}
+void
+test07()
+{
+ struct move_only_output_iterator
+ {
+ using value_type = int;
+ using difference_type = short;
+ using iterator_category = std::output_iterator_tag;
+
+ move_only_output_iterator() = default;
+ move_only_output_iterator(move_only_output_iterator&&) = default;
+ move_only_output_iterator& operator=(move_only_output_iterator&&) = default;
+
+ move_only_output_iterator& operator*() { return *this; }
+ move_only_output_iterator& operator++() { return *this; }
+ move_only_output_iterator operator++(int) { return std::move(*this); }
+
+ void operator=(int) { }
+ };
+
+ ranges::copy(std::vector<int>{1,2,3}, move_only_output_iterator{});
+}
+
int
main()
{
@@ -235,4 +258,5 @@ main()
test04();
static_assert(test05());
test06();
+ test07();
}