Suppress a bogus warning

This commit is contained in:
Victor Zverovich 2023-06-13 12:28:44 +03:00
parent c86fe0b8d3
commit 977d887a4e

View File

@ -953,6 +953,8 @@ class basic_memory_buffer final : public detail::buffer<T> {
T* old_data = this->data();
T* new_data =
std::allocator_traits<Allocator>::allocate(alloc_, new_capacity);
// Suppress a bogus -Wstringop-overflow in gcc 13.1 (#3481).
FMT_ASSERT(this->size() <= new_capacity, "");
// The following code doesn't throw, so the raw pointer above doesn't leak.
std::uninitialized_copy(old_data, old_data + this->size(),
detail::make_checked(new_data, new_capacity));