[libcxx-commits] [libcxx] [libcxx] Remove TODO related to dead_on_return (PR #194264)
Aiden Grossman via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Apr 26 13:04:50 PDT 2026
https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/194264
dead_on_return is now implemented, so remove the TODO. Still reset the buffer with __uninitialized_tag however, as it does not seem to have any adverse effects and caught something like 10-20 use-after-destroys when using msan in our internal code base.
>From 5315029ea0d30ddf3378b651b2f126a14f896af7 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sun, 26 Apr 2026 19:59:22 +0000
Subject: [PATCH] [libcxx] Remove TODO related to dead_on_return
dead_on_return is now implemented, so remove the TODO. Still reset the
buffer with __uninitialized_tag however, as it does not seem to have any
adverse effects and caught something like 10-20 use-after-destroys when
using msan in our internal code base.
---
libcxx/include/string | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libcxx/include/string b/libcxx/include/string
index 0c8767df2cdd2..6913e7d8cfe27 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1184,9 +1184,6 @@ public:
}
# endif // _LIBCPP_CXX03_LANG
- // TODO(boomanaiden154): Once we mark this in destructors as dead on return,
- // we can use a normal call to __reset_internal_buffer and remove the extra
- // __rep constructor.
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() { __reset_internal_buffer(__rep(__uninitialized_tag())); }
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT {
More information about the libcxx-commits
mailing list