[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)
Vitaly Buka via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 26 13:46:06 PDT 2024
vitalybuka wrote:
@ldionne looks like a bug in std::string
```
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1123,7 +1123,7 @@ public:
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string() {
__annotate_delete();
if (__is_long())
- __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
+ __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap() + 1);
}
```
https://github.com/llvm/llvm-project/pull/83774
More information about the cfe-commits
mailing list