libstdc++: Issues with range access CPOs (P2091R0)
authorJonathan Wakely <jwakely@redhat.com>
Thu, 20 Feb 2020 13:20:44 +0000 (13:20 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 20 Feb 2020 13:22:29 +0000 (13:22 +0000)
commite817c23f6806a6b9201a0a1f77b51cb863af51e9
treea1ae7cf999a4a9cd604d98d347412df661b24aac
parent4be779f59b04947324889b7e1488fb9a68c81d53
libstdc++: Issues with range access CPOs (P2091R0)

This changes how arrays of unknown bound and/or incomplete element type
are handled.

* include/bits/range_access.h (ranges::begin): Reject array of
incomplete type.
(ranges::end, ranges::size): Require arrays to be bounded.
(ranges::data): Require lvalue or borrowed_range.
(ranges::iterator_t): Remove constraint.
* testsuite/std/ranges/access/begin.cc: Do not check array of
incomplete type.
* testsuite/std/ranges/access/begin_neg.cc: New test.
* testsuite/std/ranges/access/end_neg.cc: Adjust expected error.
* testsuite/std/ranges/access/size_neg.cc: Adjust expected error.
* testsuite/std/ranges/access/ssize.cc: Do not check array of
incomplete type.
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/range_access.h
libstdc++-v3/testsuite/std/ranges/access/begin.cc
libstdc++-v3/testsuite/std/ranges/access/begin_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/std/ranges/access/end_neg.cc
libstdc++-v3/testsuite/std/ranges/access/size_neg.cc
libstdc++-v3/testsuite/std/ranges/access/ssize.cc