Skip to content

Commit a98ac47

Browse files
feedback
1 parent 9de412d commit a98ac47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libcxx/include/string

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
644644
# include <__utility/forward.h>
645645
# include <__utility/is_pointer_in_range.h>
646646
# include <__utility/move.h>
647+
# include <__utility/no_destroy.h>
647648
# include <__utility/scope_guard.h>
648649
# include <__utility/swap.h>
649650
# include <climits>
@@ -918,6 +919,7 @@ private:
918919
__rep() = default;
919920
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __rep(__short __r) : __s(__r) {}
920921
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __rep(__long __r) : __l(__r) {}
922+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __rep(__uninitialized_tag) {}
921923
};
922924

923925
_LIBCPP_COMPRESSED_PAIR(__rep, __rep_, allocator_type, __alloc_);
@@ -1210,7 +1212,7 @@ public:
12101212
}
12111213
# endif // _LIBCPP_CXX03_LANG
12121214

1213-
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() { __deallocate_buffer_if_long(); }
1215+
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() { __reset_internal_buffer(__rep(__uninitialized_tag())); }
12141216

12151217
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT {
12161218
return __self_view(typename __self_view::__assume_valid(), data(), size());

0 commit comments

Comments
 (0)