[libcxx-commits] [libcxx] [libc++][hardening] Use bounded iterators in std::vector and std::string (PR #78929)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 19 11:39:19 PDT 2024


================
@@ -786,9 +787,16 @@ public:
                 "[allocator.requirements] states that rebinding an allocator to the same type should result in the "
                 "original allocator");
 
-  // TODO: Implement iterator bounds checking without requiring the global database.
+#ifdef _LIBCPP_ABI_BOUNDED_ITERATORS
+  // The pointer must be passed through __wrap_iter because
+  // __alloc_traits::pointer may not be detected as a continguous iterator on
+  // its own.
----------------
ldionne wrote:

```suggestion
  // __alloc_traits::pointer may not be detected as a continguous iterator on
  // its own before C++20.
```

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


More information about the libcxx-commits mailing list