[libc++][test] Use LIBCPP_STATIC_ASSERT for std::__mdspan_detail#73436
Conversation
|
@llvm/pr-subscribers-libcxx Author: Stephan T. Lavavej (StephanTLavavej) ChangesFound while running libc++'s test suite against MSVC's STL.
I checked for other occurrences and these appear to be the only ones which have appeared since our last libc++ test suite update. Full diff: https://github.com/llvm/llvm-project/pull/73436.diff 3 Files Affected:
diff --git a/libcxx/test/std/containers/views/mdspan/layout_left/static_requirements.pass.cpp b/libcxx/test/std/containers/views/mdspan/layout_left/static_requirements.pass.cpp
index b74d129946d40dd..366498803a2ded5 100644
--- a/libcxx/test/std/containers/views/mdspan/layout_left/static_requirements.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/layout_left/static_requirements.pass.cpp
@@ -87,7 +87,7 @@
template <class M, size_t... Idxs>
void test_mapping_requirements(std::index_sequence<Idxs...>) {
using E = typename M::extents_type;
- static_assert(std::__mdspan_detail::__is_extents_v<E>);
+ LIBCPP_STATIC_ASSERT(std::__mdspan_detail::__is_extents_v<E>);
static_assert(std::is_copy_constructible_v<M>);
static_assert(std::is_nothrow_move_constructible_v<M>);
static_assert(std::is_nothrow_move_assignable_v<M>);
diff --git a/libcxx/test/std/containers/views/mdspan/layout_right/static_requirements.pass.cpp b/libcxx/test/std/containers/views/mdspan/layout_right/static_requirements.pass.cpp
index 33e736b15029c7d..d460f1a5dbc468a 100644
--- a/libcxx/test/std/containers/views/mdspan/layout_right/static_requirements.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/layout_right/static_requirements.pass.cpp
@@ -87,7 +87,7 @@
template <class M, size_t... Idxs>
void test_mapping_requirements(std::index_sequence<Idxs...>) {
using E = typename M::extents_type;
- static_assert(std::__mdspan_detail::__is_extents_v<E>);
+ LIBCPP_STATIC_ASSERT(std::__mdspan_detail::__is_extents_v<E>);
static_assert(std::is_copy_constructible_v<M>);
static_assert(std::is_nothrow_move_constructible_v<M>);
static_assert(std::is_nothrow_move_assignable_v<M>);
diff --git a/libcxx/test/std/containers/views/mdspan/layout_stride/static_requirements.pass.cpp b/libcxx/test/std/containers/views/mdspan/layout_stride/static_requirements.pass.cpp
index 112f4b9e5a04033..b56d0087260d1fc 100644
--- a/libcxx/test/std/containers/views/mdspan/layout_stride/static_requirements.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/layout_stride/static_requirements.pass.cpp
@@ -87,7 +87,7 @@
template <class M, size_t... Idxs>
void test_mapping_requirements(std::index_sequence<Idxs...>) {
using E = typename M::extents_type;
- static_assert(std::__mdspan_detail::__is_extents_v<E>);
+ LIBCPP_STATIC_ASSERT(std::__mdspan_detail::__is_extents_v<E>);
static_assert(std::is_copy_constructible_v<M>);
static_assert(std::is_nothrow_move_constructible_v<M>);
static_assert(std::is_nothrow_move_assignable_v<M>);
|
|
Merged as the CI had only unrelated failures in std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp none of which were changed here. Thanks! |
Found while running libc++'s test suite against MSVC's STL.
libcxx/test/stdshould be portable, so these lines checkingstd::__mdspan_detailmachinery should be usingLIBCPP_STATIC_ASSERT.I checked for other occurrences and these appear to be the only ones which have appeared since our last libc++ test suite update.