[libcxx-commits] [libcxx] [libc++][test] Use `LIBCPP_STATIC_ASSERT` to deal with `noexcept` strengthening (PR #74254)

Stephan T. Lavavej via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 6 18:10:27 PST 2023


================
@@ -141,12 +141,12 @@ constexpr void test_mdspan_types(const H& handle, const M& map, const A& acc) {
   ASSERT_SAME_TYPE(decltype(m.is_unique()), bool);
   ASSERT_SAME_TYPE(decltype(m.is_exhaustive()), bool);
   ASSERT_SAME_TYPE(decltype(m.is_strided()), bool);
-  assert(!noexcept(MDS::is_always_unique()));
-  assert(!noexcept(MDS::is_always_exhaustive()));
-  assert(!noexcept(MDS::is_always_strided()));
-  assert(!noexcept(m.is_unique()));
-  assert(!noexcept(m.is_exhaustive()));
-  assert(!noexcept(m.is_strided()));
+  LIBCPP_STATIC_ASSERT(!noexcept(MDS::is_always_unique()));
----------------
StephanTLavavej wrote:

I've submitted an LWG issue and as soon as I get a number I can update your product and test code here.

(The LWG issue covers only `mdspan::is_always_meow()`. Our `basic_stringbuf` `swap` strengthening is for something that technically has preconditions, since non-equal non-POCS allocators are forbidden at runtime.)

https://github.com/llvm/llvm-project/pull/74254


More information about the libcxx-commits mailing list