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

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 12 07:45:40 PDT 2026


================
@@ -23,6 +23,19 @@ class AbstractClass {
   virtual void method() = 0;
 };
 
+struct BadAccessor {
+  using offset_policy    = BadAccessor;
+  using element_type     = void;
+  using reference        = void;
+  using data_handle_type = element_type*;
+  reference access(data_handle_type, std::size_t) const;
+};
+
+int incomplete_type() {
----------------
frederick-vs-ja wrote:

Non-`void` return type doesn't make sense here.
```suggestion
void incomplete_type() {
```

Also, can we also cover rejection of function and reference types? (Maybe in another PR.)

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


More information about the libcxx-commits mailing list