[libcxx-commits] [libcxx] [libc++] Fix the mdspan ElementType complete object type mandate (PR #191703)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 12 07:29:27 PDT 2026


================
@@ -66,6 +67,9 @@ class mdspan {
 private:
   static_assert(__mdspan_detail::__is_extents_v<_Extents>,
                 "mdspan: Extents template parameter must be a specialization of extents.");
+  static_assert(
----------------
eiytoq wrote:

According to [[meta.unary.prop](https://eel.is/c++draft/meta.unary.prop#tab:meta.unary.prop)], `is_abstract_v` has a precondition:

>If T is a non-union class type, T shall be a complete type.

So I don't think we can rely on that being a hard error. `requires { sizeof(_ElementType); }` makes sense.

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


More information about the libcxx-commits mailing list