[libcxx-commits] [PATCH] D119214: [libc++][ranges][NFC] Refactor tests for `ranges::{begin, end}`.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 8 20:45:54 PST 2022


var-const added inline comments.


================
Comment at: libcxx/test/std/ranges/range.access/begin.pass.cpp:32-41
+static_assert(!std::is_invocable_v<RangeCBeginT, int (&&)[10]>);
+static_assert( std::is_invocable_v<RangeCBeginT, int (&)[10]>);
+static_assert(!std::is_invocable_v<RangeCBeginT, int (&&)[]>);
+static_assert( std::is_invocable_v<RangeCBeginT, int (&)[]>);
 
 struct Incomplete;
 static_assert(!std::is_invocable_v<RangeBeginT, Incomplete(&&)[]>);
----------------
Quuxplusone wrote:
> Looks like you had a merge conflict here. Please take what's on the left-hand side.
> Your new lines 39 and 41 are the IFNDR case (right?), so we can't `static_assert` anything about them; we must `LIBCPP_STATIC_ASSERT` as seen on the left-hand side.
Thanks! Sorry, yeah, I accidentally overwrote the changes on `main`.


================
Comment at: libcxx/test/std/ranges/range.access/end.pass.cpp:155
+};
+static_assert(!std::is_invocable_v<RangeEndT, EmptyEndMember const&>);
+
----------------
Quuxplusone wrote:
> FWIW, here the main problem is that `iterator_t<EmptyEndMember>` is ill-formed because `Empty` is not an iterator type; we never even really get around to checking whether `t.end()` is well-formed. So I question the usefulness of this test case. But it's harmless.
I agree. It's a preexistent test case, but I'm quite open to deleting it -- just let me know if you'd prefer to do it in this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119214



More information about the libcxx-commits mailing list