[libcxx-commits] [PATCH] D98573: [libc++] Remove the special logic for "noexcept iterators" in basic_string

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 17 22:04:42 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/string:2161-2176
+#ifndef _LIBCPP_NO_EXCEPTIONS
+    try
+    {
+#endif  // _LIBCPP_NO_EXCEPTIONS
     for (; __first != __last; ++__first, (void) ++__p)
         traits_type::assign(*__p, *__first);
     traits_type::assign(*__p, value_type());
----------------
@ldionne @EricWF I'd appreciate some extra eyeballs on this part. This memory leak was detected by ASAN: https://buildkite.com/llvm-project/libcxx-ci/builds/2613#fc0d2573-8a43-4b02-b142-009a84ef9b06  I'm not real familiar with the role of `basic_string::__init`; this fix //seems// straightforward, but I wonder if there's a subtle reason someone left it off originally. Compare to lines 2118–2132 above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98573



More information about the libcxx-commits mailing list