r277666 - in /trunk/libstdc++-v3: ChangeLog inc...

redi@gcc.gnu.org redi@gcc.gnu.org
Thu Oct 31 13:17:00 GMT 2019


Author: redi
Date: Thu Oct 31 13:17:42 2019
New Revision: 277666

URL: https://gcc.gnu.org/viewcvs?rev=277666&root=gcc&view=rev
Log:
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.

Added:
    trunk/libstdc++-v3/testsuite/std/ranges/access/end_neg.cc
    trunk/libstdc++-v3/testsuite/std/ranges/access/size_neg.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/range_access.h
    trunk/libstdc++-v3/testsuite/std/ranges/access/begin.cc
    trunk/libstdc++-v3/testsuite/std/ranges/access/size.cc



More information about the Libstdc++-cvs mailing list