[libcxx-commits] [libcxx] Add lifetimebound to std::basic_string::opeator std::string_view (PR #112614)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 16 13:53:46 PDT 2024


https://github.com/higher-performance created https://github.com/llvm/llvm-project/pull/112614

This should fix #112234.

>From ed5f2345d13415f451588ac9b7df47f76721829b Mon Sep 17 00:00:00 2001
From: higher-performance <higher.performance.github at gmail.com>
Date: Wed, 16 Oct 2024 16:52:51 -0400
Subject: [PATCH] Add lifetimebound to std::basic_string::opeator
 std::string_view

---
 libcxx/include/string | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/string b/libcxx/include/string
index e8c9bcee53e3df..f6dd7293de90ca 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1213,7 +1213,7 @@ public:
       __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT {
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT _LIBCPP_LIFETIMEBOUND {
     return __self_view(typename __self_view::__assume_valid(), data(), size());
   }
 



More information about the libcxx-commits mailing list