[libcxx-commits] [libcxx] [libc++][Docs] Document `std::optional` hardening (PR #218173)

William Tran-Viet via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 22 17:39:43 PDT 2026


https://github.com/smallp-o-p created https://github.com/llvm/llvm-project/pull/218173

Resolves #218041 

>From 0fbdc8d5fa5713682b19108a470f21108dae5e3b Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Sat, 22 Aug 2026 20:35:32 -0400
Subject: [PATCH] Update hardening docs

---
 libcxx/docs/Hardening.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libcxx/docs/Hardening.rst b/libcxx/docs/Hardening.rst
index 1360518379aef..0237a0e73aba0 100644
--- a/libcxx/docs/Hardening.rst
+++ b/libcxx/docs/Hardening.rst
@@ -440,6 +440,12 @@ CMake configuration time. The available options are:
 
   ABI impact: changes the iterator type of ``std::array``, its size and its layout.
 
+- ``_LIBCPP_ABI_BOUNDED_ITERATORS_IN_OPTIONAL`` -- changes the iterator type of ``std::optional`` to a
+  bounded iterator that keeps track of whether it's within the bounds of its container and asserts it
+  on every dereference and when performing iterator arithmetic.
+
+  ABI impact: changes the iterator type of ``std::optional``.
+
 ABI tags
 --------
 



More information about the libcxx-commits mailing list