[libcxx-commits] [libcxx] [libc++] Resolve LWG4308: `std::optional<T&>::iterator` can't be a contiguous iterator for some T (PR #173948)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 29 22:24:09 PST 2025


================
@@ -681,11 +681,12 @@ struct __is_std_optional<optional<_Tp>> : true_type {};
 template <class _Tp, class = void>
 struct __optional_iterator {};
 
+// LWG4308 optional<T&>: Constraint: T is an object type other than an array of unknown bound.
----------------
frederick-vs-ja wrote:

We need to update this line.

https://github.com/llvm/llvm-project/blob/44e32ccf0343e5df6bb0afa7121fdd50979b696e/libcxx/docs/Status/Cxx2cIssues.csv#L187

Also, I don't think we should mention LWG issue in comments in libc++'s headers, except that the status is unusual (e.g. the LWG issue is not adopted, or not backported even though backport is theoretically possible, or backported in some unusual way).

There're some historical unconventional comments for LWG issues, perhaps we should remove them in a future PR.

```suggestion
```

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


More information about the libcxx-commits mailing list