From: Jonathan Wakely Date: Wed, 19 Feb 2020 21:56:29 +0000 (+0000) Subject: libstdc++: make common_iterator require copyable (LWG 3385) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b425f3ac516f7250e9f7eac7cd4fe0908ccfa4e;p=gcc.git libstdc++: make common_iterator require copyable (LWG 3385) * include/bits/stl_iterator.h (common_iterator): Add copyable requirement (LWG 3385). * testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust expected declaration. --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ef91b80ef45..7f3f8876957 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2020-02-19 Jonathan Wakely + * include/bits/stl_iterator.h (common_iterator): Add copyable + requirement (LWG 3385). + * testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust + expected declaration. + * include/std/ranges (take_while_view, drop_view, drop_while_view) (elements_view:_Iterator): Initialize data members (LWG 3364). diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index fc9d442b475..372df223113 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -1426,7 +1426,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// An iterator/sentinel adaptor for representing a non-common range. template _Sent> - requires (!same_as<_It, _Sent>) + requires (!same_as<_It, _Sent>) && copyable<_It> class common_iterator { template diff --git a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc index 4d8eca31d38..fbe116be2fd 100644 --- a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc +++ b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc @@ -56,7 +56,7 @@ namespace std template class move_sentinel; template S> - requires (!same_as) + requires (!same_as) && copyable class common_iterator; template