55823c5a0b
Passing IncompleteType(&)[] to ranges::begin produces an error outside the immediate context, which is fine for ranges::begin, but it means that we fail to enforce the SFINAE-able constraints for ranges::size and ranges::size. They should not be callable for any array of unknown bound, whether the type is complete or not. Because we don't enforce that in their constraints, we get a hard error when they try to use ranges::begin. This simply adds explicit checks for arrays of unknown bound to the constraints for ranges::size and ranges::empty. We only need to check it for the __sentinel_size and __eq_iter_empty concepts, because those are the ones that are relevant to arrays, and which try to use ranges::begin. libstdc++-v3/ChangeLog: * include/bits/ranges_base.h (ranges::size, ranges::empty): Add explicit check for unbounded arrays before using ranges::begin. * testsuite/std/ranges/access/empty.cc: Check handling of unbounded arrays. * testsuite/std/ranges/access/size.cc: Likewise. |
||
---|---|---|
.. | ||
17_intro | ||
18_support | ||
19_diagnostics | ||
20_util | ||
21_strings | ||
22_locale | ||
23_containers | ||
24_iterators | ||
25_algorithms | ||
26_numerics | ||
27_io | ||
28_regex | ||
29_atomics | ||
30_threads | ||
abi | ||
backward | ||
config | ||
data | ||
decimal | ||
experimental | ||
ext | ||
lib | ||
libstdc++-abi | ||
libstdc++-dg | ||
libstdc++-prettyprinters | ||
libstdc++-xmethods | ||
performance | ||
special_functions | ||
std | ||
tr1 | ||
tr2 | ||
util | ||
Makefile.am | ||
Makefile.in |