Skip to content

Commit

Permalink
Suppress a bogus warning
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jun 13, 2023
1 parent c86fe0b commit 977d887
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
# if FMT_CPLUSPLUS >= 202002L
# if FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
# elif FMT_MSC_VERSION >= 1929 // VS2019 v16.10 and later
# elif FMT_MSC_VERSION >= 1929 // VS2019 v16.10 and later
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
# endif
# else
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 977d887

Please sign in to comment.