[libcxx-commits] [libcxx] 7f41025 - [libcxx][test] Remove redundant semiregular checks for CPOs
Joe Loser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Dec 28 19:10:13 PST 2021
Author: Joe Loser
Date: 2021-12-28T22:09:12-05:00
New Revision: 7f410251e8d483e57ad54340ad968e4b498461da
URL: https://github.com/llvm/llvm-project/commit/7f410251e8d483e57ad54340ad968e4b498461da
DIFF: https://github.com/llvm/llvm-project/commit/7f410251e8d483e57ad54340ad968e4b498461da.diff
LOG: [libcxx][test] Remove redundant semiregular checks for CPOs
Some individual test files verify the CPO under test satisfies
`semiregular` concept. This is redundant since it is already part of the test
in verifying whether the entity is indeed a CPO in
`libcxx/test/std/library/description/conventions/customization.point.object/cpo.compile.pass.cpp`.
Differential Revision: https://reviews.llvm.org/D116173
Added:
Modified:
libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.swap.pass.cpp
libcxx/test/std/ranges/range.access/size.pass.cpp
libcxx/test/std/ranges/range.access/ssize.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.swap.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.swap.pass.cpp
index 31ecbb3bb34ab..1d578a9ea126c 100644
--- a/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.swap.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.swap.pass.cpp
@@ -22,8 +22,6 @@
using IterSwapT = decltype(std::ranges::iter_swap);
-static_assert(std::semiregular<std::remove_cv_t<IterSwapT>>);
-
struct HasIterSwap {
int &value_;
explicit HasIterSwap(int &value) : value_(value) { assert(value == 0); }
diff --git a/libcxx/test/std/ranges/range.access/size.pass.cpp b/libcxx/test/std/ranges/range.access/size.pass.cpp
index 4d91e3dafebdc..0a45a2d7c4988 100644
--- a/libcxx/test/std/ranges/range.access/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/size.pass.cpp
@@ -36,8 +36,6 @@ static_assert(std::ranges::size(std::move(array_of_incomplete)) == 42);
static_assert(std::ranges::size(std::as_const(array_of_incomplete)) == 42);
static_assert(std::ranges::size(static_cast<const Incomplete(&&)[42]>(array_of_incomplete)) == 42);
-static_assert(std::semiregular<std::remove_cv_t<RangeSizeT>>);
-
struct SizeMember {
constexpr size_t size() { return 42; }
};
diff --git a/libcxx/test/std/ranges/range.access/ssize.pass.cpp b/libcxx/test/std/ranges/range.access/ssize.pass.cpp
index beedcfa9908bb..39e7b80e21639 100644
--- a/libcxx/test/std/ranges/range.access/ssize.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/ssize.pass.cpp
@@ -25,8 +25,6 @@ static_assert( std::is_invocable_v<RangeSSizeT, int[1]>);
static_assert( std::is_invocable_v<RangeSSizeT, int (&&)[1]>);
static_assert( std::is_invocable_v<RangeSSizeT, int (&)[1]>);
-static_assert(std::semiregular<std::remove_cv_t<RangeSSizeT>>);
-
struct SizeMember {
constexpr size_t size() { return 42; }
};
diff --git a/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
index 29a891174b587..d19c991a508a5 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
@@ -48,9 +48,6 @@ constexpr bool test() {
{
static_assert(std::addressof(std::views::counted) == std::addressof(std::ranges::views::counted));
- auto copy = std::views::counted;
- static_assert(std::semiregular<decltype(copy)>);
-
static_assert( CountedInvocable<int*, size_t>);
static_assert(!CountedInvocable<int*, LvalueConvertible>);
static_assert( CountedInvocable<int*, LvalueConvertible&>);
diff --git a/libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp
index 6fcb4abe21dec..1a6f7e1fe203f 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp
@@ -43,11 +43,6 @@ constexpr void testType(U u) {
ASSERT_SAME_TYPE(decltype(std::views::iota(T(10))), std::ranges::iota_view<T>);
ASSERT_SAME_TYPE(decltype(std::views::iota(T(10), u)), std::ranges::iota_view<T, U>);
}
- // Test that this is semiregular.
- // Note: we cannot test perfect forwarding because both T and U must be copyable.
- {
- static_assert(std::semiregular<std::remove_const_t<decltype(std::views::iota)>>);
- }
}
struct X {};
More information about the libcxx-commits
mailing list