diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-10-31 13:17:42 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-10-31 13:17:42 +0000 |
commit | beaecb2d6b2f3c48740b7b8749ee2d2468c8dc14 (patch) | |
tree | d236c984006772b50b0af417599e440fc4027102 /libcpp | |
parent | d9a6144c87bd4c15c855785ced57907d66754861 (diff) | |
download | gcc-beaecb2d6b2f3c48740b7b8749ee2d2468c8dc14.zip gcc-beaecb2d6b2f3c48740b7b8749ee2d2468c8dc14.tar.gz gcc-beaecb2d6b2f3c48740b7b8749ee2d2468c8dc14.tar.bz2 |
Fix handling of arrays in range access customization points
This combines the overloads for arrays with the non-array overloads,
using if-constexpr to choose between the cases, and also enforces the
following:
- ADL should only be used for class types and enumeration types.
- ranges::begin should be ill-formed for rvalue arrays.
- ranges::end should be ill-formed for rvalue arrays, unbounded
arrays, and arrays of incomplete type.
- ranges::size should be ill-formed for unbounded arrays.
* include/bits/range_access.h (ranges::begin): Combine array and
non-array overloads into one function template. Only use ADL for
classes and enums
(ranges::end, ranges::size): Likewise. Make unbounded arrays
ill-formed.
(ranges::rbegin, ranges::rend): Only use ADL for classes and enums.
Reformat _S_noexcept() functions to mirror operator() structure.
* testsuite/std/ranges/access/begin.cc: Check incomplete array.
* testsuite/std/ranges/access/end_neg.cc: New test.
* testsuite/std/ranges/access/size.cc: Check array of incomplete type.
* testsuite/std/ranges/access/size_neg.cc: New test.
From-SVN: r277666
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions