[libcxx-commits] [libcxx] [libc++] Assert that the resize_and_overwrite operation returns a size in [0, n] (PR #230605)
Ilyas Mallah via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Oct 13 03:29:34 PDT 2026
================
@@ -1250,7 +1252,15 @@ public:
__annotate_delete();
__set_size(__n);
__annotate_new(__n);
- __erase_to_end(std::move(__op)(data(), auto(__n)));
+ __result_type __r = std::move(__op)(data(), auto(__n));
+ if constexpr (__integer_like<__result_type>) { // Avoid extra errors after a failed static_assert
+ if constexpr (is_signed_v<__result_type>)
----------------
ilyas-mallah wrote:
Removed. The `static_assert` I meant is this one: https://github.com/llvm/llvm-project/blob/ae751639f3ef54440accf4c6769de630c3ec5931/libcxx/include/string#L1246
https://github.com/llvm/llvm-project/pull/230605
More information about the libcxx-commits
mailing list