Disable Arena copy constructor in repeated fields.

PiperOrigin-RevId: 568905275
pull/14231/head
Martijn Vels 1 year ago committed by Copybara-Service
parent 8f236c2f7b
commit 9149c4825d
  1. 4
      src/google/protobuf/repeated_ptr_field.h

@ -299,7 +299,9 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase {
// Message creating functor: used in MergeFrom<T>()
template <typename T>
static MessageLite* CopyMessage(Arena* arena, const MessageLite& src) {
return Arena::CreateMaybeMessage<T>(arena, static_cast<const T&>(src));
T* msg = Arena::CreateMaybeMessage<T>(arena);
msg->MergeFrom(static_cast<const T&>(src));
return msg;
}
// Appends all message values from `from` to this instance.

Loading…
Cancel
Save