[libcxx-commits] [PATCH] D100255: [libcxx][ranges] adds `range` access CPOs

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 29 23:48:52 PDT 2021


cjdb added inline comments.


================
Comment at: libcxx/test/std/ranges/range.access/range.access.begin/incomplete.compile.verify.cpp:28
+  struct incomplete;
+  f<incomplete(&)[10]>();
+  // expected-error@*:* {{"`std::ranges::begin` is SFINAE-unfriendly on arrays of an incomplete type."}}
----------------
zoecarver wrote:
> I think it would make more sense to call `std::ranges::begin` directly here. Certainly don't use `__begin::__fn`, especially if it's not in a libc++ test (which this probably shouldn't be anyway).
Do you mean something like `static_assert(requires { std::ranges::begin(std::declval<incomplete(&)[]>()) });`?


================
Comment at: libcxx/test/std/ranges/range.access/range.access.end/end.cpp:22
+
+using RangeEndT = decltype(std::ranges::end)&;
+using RangeCEndT = decltype(std::ranges::cend)&;
----------------
zoecarver wrote:
> Why are we making this a reference type?
`std::ranges::end(x)` is invoking `std::ranges::__end::__fn::operator()` as an lvalue, so we should be checking that, IMO.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100255/new/

https://reviews.llvm.org/D100255



More information about the libcxx-commits mailing list