[libcxx-commits] [PATCH] D142903: [libc++] Use bounded iterators in std::string_view when the debug mode is enabled

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 31 11:29:37 PST 2023


Mordante accepted this revision.
Mordante added a comment.
This revision is now accepted and ready to land.

Thanks a lot for working on this and fixing the format header.
LGTM modulo some nits.



================
Comment at: libcxx/test/std/strings/string.view/string.view.iterators/debug.iterator-indexing.pass.cpp:7
+//
+//===----------------------------------------------------------------------===//
+
----------------
Why is this not a libc++ specific test? 


================
Comment at: libcxx/test/std/strings/string.view/string.view.iterators/debug.iterator-indexing.pass.cpp:18-20
+struct Foo {
+    int x;
+};
----------------
Unused.


================
Comment at: libcxx/test/std/strings/string.view/string.view.iterators/debug.iterator-indexing.pass.cpp:27
+        {
+            auto it = str.end();
+            TEST_LIBCPP_ASSERT_FAILURE(*it, "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
----------------
Should we also test with `cfoo` and `crfoo`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142903/new/

https://reviews.llvm.org/D142903



More information about the libcxx-commits mailing list