diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index b42d47904..137b29be5 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -1223,7 +1223,7 @@ void RepeatedField::Reserve(int new_size) { Arena* arena = GetArenaNoVirtual(); new_size = max(google::protobuf::internal::kMinRepeatedFieldAllocationSize, max(total_size_ * 2, new_size)); - GOOGLE_CHECK_LE(new_size, + GOOGLE_CHECK_LE(static_cast(new_size), (std::numeric_limits::max() - kRepHeaderSize) / sizeof(Element)) << "Requested size is too large to fit into size_t.";