[libcxx-commits] [libcxx] [libc++] Implement P2988R12: `std::optional<T&>` (PR #155202)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 7 04:05:33 PST 2025


================
@@ -53,6 +54,10 @@ constexpr bool tests() {
   assert(test<char>());
   assert(test<const int>());
   assert(test<const char>());
+  assert(test<int&>());
+  assert(test<char&>());
+  assert(test<const int&>());
+  assert(test<const char&>());
----------------
frederick-vs-ja wrote:

Ditto, if you think it's better not to delay implementing LWG4308, cases for `int (&)[42]` and its friends should also be added.

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


More information about the libcxx-commits mailing list