Apply C++20 changes to various iterator types
authorJonathan Wakely <jwakely@redhat.com>
Wed, 30 Oct 2019 15:48:11 +0000 (15:48 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 30 Oct 2019 15:48:11 +0000 (15:48 +0000)
commit9aeb3bef2cae234dbb90609392e536bafc09365c
tree1359fb3c7db320eb8d70c477c13efbf908cea2c0
parent5211593c58c15a2a011003fa55acc62422609107
Apply C++20 changes to various iterator types

This ensures that __normal_iterator<T*, C> satisfies the
contiguous_iterator concept, by defining the iterator_concept member
type.

Also update vector<bool>'s iterators, reverse_iterator,
istreambuf_iterator and ostreambuf_iterator to meet the C++20
requirements.

PR libstdc++/92272
* include/bits/stl_bvector.h (_Bit_iterator::pointer)
(_Bit_const_iterator::pointer): Define as void for C++20.
* include/bits/stl_iterator.h (reverse_iterator::operator->()): Add
constraints for C++20.
(__normal_iterator::iterator_concept): Define for C++20.
* include/bits/streambuf_iterator.h (istreambuf_iterator::pointer):
Define as void for C++20.
(ostreambuf_iterator::difference_type): Define as ptrdiff_t for C++20.
(ostreambuf_iterator::ostreambuf_iterator()): Add default constructor
for C++20.
* testsuite/23_containers/vector/bool/iterator_c++20.cc: New test.
* testsuite/24_iterators/bidirectional/concept.cc: New test.
* testsuite/24_iterators/bidirectional/tag.cc: New test.
* testsuite/24_iterators/contiguous/concept.cc: New test.
* testsuite/24_iterators/contiguous/tag.cc: New test.
* testsuite/24_iterators/forward/concept.cc: New test.
* testsuite/24_iterators/forward/tag.cc: New test.
* testsuite/24_iterators/input/concept.cc: New test.
* testsuite/24_iterators/input/tag.cc: New test.
* testsuite/24_iterators/istreambuf_iterator/requirements/typedefs.cc:
New test.
* testsuite/24_iterators/ostreambuf_iterator/requirements/typedefs.cc:
New test.
* testsuite/24_iterators/output/concept.cc: New test.
* testsuite/24_iterators/output/tag.cc: New test.
* testsuite/24_iterators/random_access/concept.cc: New test.
* testsuite/24_iterators/random_access/tag.cc: New test.
* testsuite/24_iterators/range_operations/advance_debug_neg.cc: New
test.
* testsuite/24_iterators/random_access_iterator/26020.cc: Move to ...
* testsuite/24_iterators/operations/26020.cc: ... here.
* testsuite/24_iterators/random_access_iterator/
string_vector_iterators.cc: Move to ...
* testsuite/24_iterators/random_access/string_vector_iterators.cc: ...
here.

From-SVN: r277629
24 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/stl_iterator.h
libstdc++-v3/include/bits/streambuf_iterator.h
libstdc++-v3/testsuite/23_containers/vector/bool/iterator_c++20.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/bidirectional/concept.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/bidirectional/tag.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/contiguous/concept.cc
libstdc++-v3/testsuite/24_iterators/contiguous/tag.cc
libstdc++-v3/testsuite/24_iterators/forward/concept.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/forward/tag.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/input/concept.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/input/tag.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/typedefs.cc
libstdc++-v3/testsuite/24_iterators/operations/26020.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/requirements/typedefs.cc
libstdc++-v3/testsuite/24_iterators/output/concept.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/output/tag.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/random_access/concept.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/random_access/string_vector_iterators.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/random_access/tag.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/random_access_iterator/26020.cc [deleted file]
libstdc++-v3/testsuite/24_iterators/random_access_iterator/string_vector_iterators.cc [deleted file]
libstdc++-v3/testsuite/24_iterators/range_operations/advance_debug_neg.cc [new file with mode: 0644]