// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/protobuf/unittest_drop_unknown_fields.proto

#include <google/protobuf/unittest_drop_unknown_fields.pb.h>

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)

namespace unittest_drop_unknown_fields {
class FooDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<Foo>
      _instance;
} _Foo_default_instance_;
class FooWithExtraFieldsDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<FooWithExtraFields>
      _instance;
} _FooWithExtraFields_default_instance_;
}  // namespace unittest_drop_unknown_fields
namespace protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto {
static void InitDefaultsFoo() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::unittest_drop_unknown_fields::_Foo_default_instance_;
    new (ptr) ::unittest_drop_unknown_fields::Foo();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::unittest_drop_unknown_fields::Foo::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<0> scc_info_Foo =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFoo}, {}};

static void InitDefaultsFooWithExtraFields() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::unittest_drop_unknown_fields::_FooWithExtraFields_default_instance_;
    new (ptr) ::unittest_drop_unknown_fields::FooWithExtraFields();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::unittest_drop_unknown_fields::FooWithExtraFields::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<0> scc_info_FooWithExtraFields =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFooWithExtraFields}, {}};

void InitDefaults() {
  ::google::protobuf::internal::InitSCC(&scc_info_Foo.base);
  ::google::protobuf::internal::InitSCC(&scc_info_FooWithExtraFields.base);
}

::google::protobuf::Metadata file_level_metadata[2];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];

const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::unittest_drop_unknown_fields::Foo, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::unittest_drop_unknown_fields::Foo, int32_value_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::unittest_drop_unknown_fields::Foo, enum_value_),
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::unittest_drop_unknown_fields::FooWithExtraFields, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::unittest_drop_unknown_fields::FooWithExtraFields, int32_value_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::unittest_drop_unknown_fields::FooWithExtraFields, enum_value_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::unittest_drop_unknown_fields::FooWithExtraFields, extra_int32_value_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, sizeof(::unittest_drop_unknown_fields::Foo)},
  { 7, -1, sizeof(::unittest_drop_unknown_fields::FooWithExtraFields)},
};

static ::google::protobuf::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::google::protobuf::Message*>(&::unittest_drop_unknown_fields::_Foo_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::unittest_drop_unknown_fields::_FooWithExtraFields_default_instance_),
};

void protobuf_AssignDescriptors() {
  AddDescriptors();
  AssignDescriptors(
      "google/protobuf/unittest_drop_unknown_fields.proto", schemas, file_default_instances, TableStruct::offsets,
      file_level_metadata, file_level_enum_descriptors, NULL);
}

void protobuf_AssignDescriptorsOnce() {
  static ::google::protobuf::internal::once_flag once;
  ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
}

void AddDescriptorsImpl() {
  InitDefaults();
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
      "\n2google/protobuf/unittest_drop_unknown_"
      "fields.proto\022\034unittest_drop_unknown_fiel"
      "ds\"\205\001\n\003Foo\022\023\n\013int32_value\030\001 \001(\005\022@\n\nenum_"
      "value\030\002 \001(\0162,.unittest_drop_unknown_fiel"
      "ds.Foo.NestedEnum\"\'\n\nNestedEnum\022\007\n\003FOO\020\000"
      "\022\007\n\003BAR\020\001\022\007\n\003BAZ\020\002\"\307\001\n\022FooWithExtraField"
      "s\022\023\n\013int32_value\030\001 \001(\005\022O\n\nenum_value\030\002 \001"
      "(\0162;.unittest_drop_unknown_fields.FooWit"
      "hExtraFields.NestedEnum\022\031\n\021extra_int32_v"
      "alue\030\003 \001(\005\"0\n\nNestedEnum\022\007\n\003FOO\020\000\022\007\n\003BAR"
      "\020\001\022\007\n\003BAZ\020\002\022\007\n\003QUX\020\003B,\242\002\014DropUnknowns\252\002\032"
      "Google.Protobuf.TestProtosb\006proto3"
  };
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
      descriptor, 474);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "google/protobuf/unittest_drop_unknown_fields.proto", &protobuf_RegisterTypes);
}

void AddDescriptors() {
  static ::google::protobuf::internal::once_flag once;
  ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
  StaticDescriptorInitializer() {
    AddDescriptors();
  }
} static_descriptor_initializer;
}  // namespace protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto
namespace unittest_drop_unknown_fields {
const ::google::protobuf::EnumDescriptor* Foo_NestedEnum_descriptor() {
  protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::protobuf_AssignDescriptorsOnce();
  return protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::file_level_enum_descriptors[0];
}
bool Foo_NestedEnum_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Foo_NestedEnum Foo::FOO;
const Foo_NestedEnum Foo::BAR;
const Foo_NestedEnum Foo::BAZ;
const Foo_NestedEnum Foo::NestedEnum_MIN;
const Foo_NestedEnum Foo::NestedEnum_MAX;
const int Foo::NestedEnum_ARRAYSIZE;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
const ::google::protobuf::EnumDescriptor* FooWithExtraFields_NestedEnum_descriptor() {
  protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::protobuf_AssignDescriptorsOnce();
  return protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::file_level_enum_descriptors[1];
}
bool FooWithExtraFields_NestedEnum_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const FooWithExtraFields_NestedEnum FooWithExtraFields::FOO;
const FooWithExtraFields_NestedEnum FooWithExtraFields::BAR;
const FooWithExtraFields_NestedEnum FooWithExtraFields::BAZ;
const FooWithExtraFields_NestedEnum FooWithExtraFields::QUX;
const FooWithExtraFields_NestedEnum FooWithExtraFields::NestedEnum_MIN;
const FooWithExtraFields_NestedEnum FooWithExtraFields::NestedEnum_MAX;
const int FooWithExtraFields::NestedEnum_ARRAYSIZE;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

// ===================================================================

void Foo::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Foo::kInt32ValueFieldNumber;
const int Foo::kEnumValueFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Foo::Foo()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::scc_info_Foo.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:unittest_drop_unknown_fields.Foo)
}
Foo::Foo(const Foo& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::memcpy(&int32_value_, &from.int32_value_,
    static_cast<size_t>(reinterpret_cast<char*>(&enum_value_) -
    reinterpret_cast<char*>(&int32_value_)) + sizeof(enum_value_));
  // @@protoc_insertion_point(copy_constructor:unittest_drop_unknown_fields.Foo)
}

void Foo::SharedCtor() {
  ::memset(&int32_value_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&enum_value_) -
      reinterpret_cast<char*>(&int32_value_)) + sizeof(enum_value_));
}

Foo::~Foo() {
  // @@protoc_insertion_point(destructor:unittest_drop_unknown_fields.Foo)
  SharedDtor();
}

void Foo::SharedDtor() {
}

void Foo::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Foo::descriptor() {
  ::protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const Foo& Foo::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::scc_info_Foo.base);
  return *internal_default_instance();
}


void Foo::Clear() {
// @@protoc_insertion_point(message_clear_start:unittest_drop_unknown_fields.Foo)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  ::memset(&int32_value_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&enum_value_) -
      reinterpret_cast<char*>(&int32_value_)) + sizeof(enum_value_));
  _internal_metadata_.Clear();
}

bool Foo::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:unittest_drop_unknown_fields.Foo)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // int32 int32_value = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &int32_value_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .unittest_drop_unknown_fields.Foo.NestedEnum enum_value = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          set_enum_value(static_cast< ::unittest_drop_unknown_fields::Foo_NestedEnum >(value));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:unittest_drop_unknown_fields.Foo)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:unittest_drop_unknown_fields.Foo)
  return false;
#undef DO_
}

void Foo::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:unittest_drop_unknown_fields.Foo)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 int32_value = 1;
  if (this->int32_value() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->int32_value(), output);
  }

  // .unittest_drop_unknown_fields.Foo.NestedEnum enum_value = 2;
  if (this->enum_value() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      2, this->enum_value(), output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:unittest_drop_unknown_fields.Foo)
}

::google::protobuf::uint8* Foo::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:unittest_drop_unknown_fields.Foo)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 int32_value = 1;
  if (this->int32_value() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->int32_value(), target);
  }

  // .unittest_drop_unknown_fields.Foo.NestedEnum enum_value = 2;
  if (this->enum_value() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      2, this->enum_value(), target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:unittest_drop_unknown_fields.Foo)
  return target;
}

size_t Foo::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:unittest_drop_unknown_fields.Foo)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  // int32 int32_value = 1;
  if (this->int32_value() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->int32_value());
  }

  // .unittest_drop_unknown_fields.Foo.NestedEnum enum_value = 2;
  if (this->enum_value() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::EnumSize(this->enum_value());
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Foo::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:unittest_drop_unknown_fields.Foo)
  GOOGLE_DCHECK_NE(&from, this);
  const Foo* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const Foo>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:unittest_drop_unknown_fields.Foo)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:unittest_drop_unknown_fields.Foo)
    MergeFrom(*source);
  }
}

void Foo::MergeFrom(const Foo& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:unittest_drop_unknown_fields.Foo)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.int32_value() != 0) {
    set_int32_value(from.int32_value());
  }
  if (from.enum_value() != 0) {
    set_enum_value(from.enum_value());
  }
}

void Foo::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:unittest_drop_unknown_fields.Foo)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Foo::CopyFrom(const Foo& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:unittest_drop_unknown_fields.Foo)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Foo::IsInitialized() const {
  return true;
}

void Foo::Swap(Foo* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Foo::InternalSwap(Foo* other) {
  using std::swap;
  swap(int32_value_, other->int32_value_);
  swap(enum_value_, other->enum_value_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata Foo::GetMetadata() const {
  protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::file_level_metadata[kIndexInFileMessages];
}


// ===================================================================

void FooWithExtraFields::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FooWithExtraFields::kInt32ValueFieldNumber;
const int FooWithExtraFields::kEnumValueFieldNumber;
const int FooWithExtraFields::kExtraInt32ValueFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

FooWithExtraFields::FooWithExtraFields()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::scc_info_FooWithExtraFields.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:unittest_drop_unknown_fields.FooWithExtraFields)
}
FooWithExtraFields::FooWithExtraFields(const FooWithExtraFields& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::memcpy(&int32_value_, &from.int32_value_,
    static_cast<size_t>(reinterpret_cast<char*>(&extra_int32_value_) -
    reinterpret_cast<char*>(&int32_value_)) + sizeof(extra_int32_value_));
  // @@protoc_insertion_point(copy_constructor:unittest_drop_unknown_fields.FooWithExtraFields)
}

void FooWithExtraFields::SharedCtor() {
  ::memset(&int32_value_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&extra_int32_value_) -
      reinterpret_cast<char*>(&int32_value_)) + sizeof(extra_int32_value_));
}

FooWithExtraFields::~FooWithExtraFields() {
  // @@protoc_insertion_point(destructor:unittest_drop_unknown_fields.FooWithExtraFields)
  SharedDtor();
}

void FooWithExtraFields::SharedDtor() {
}

void FooWithExtraFields::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* FooWithExtraFields::descriptor() {
  ::protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const FooWithExtraFields& FooWithExtraFields::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::scc_info_FooWithExtraFields.base);
  return *internal_default_instance();
}


void FooWithExtraFields::Clear() {
// @@protoc_insertion_point(message_clear_start:unittest_drop_unknown_fields.FooWithExtraFields)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  ::memset(&int32_value_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&extra_int32_value_) -
      reinterpret_cast<char*>(&int32_value_)) + sizeof(extra_int32_value_));
  _internal_metadata_.Clear();
}

bool FooWithExtraFields::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:unittest_drop_unknown_fields.FooWithExtraFields)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // int32 int32_value = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &int32_value_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .unittest_drop_unknown_fields.FooWithExtraFields.NestedEnum enum_value = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          set_enum_value(static_cast< ::unittest_drop_unknown_fields::FooWithExtraFields_NestedEnum >(value));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // int32 extra_int32_value = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &extra_int32_value_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:unittest_drop_unknown_fields.FooWithExtraFields)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:unittest_drop_unknown_fields.FooWithExtraFields)
  return false;
#undef DO_
}

void FooWithExtraFields::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:unittest_drop_unknown_fields.FooWithExtraFields)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 int32_value = 1;
  if (this->int32_value() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->int32_value(), output);
  }

  // .unittest_drop_unknown_fields.FooWithExtraFields.NestedEnum enum_value = 2;
  if (this->enum_value() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      2, this->enum_value(), output);
  }

  // int32 extra_int32_value = 3;
  if (this->extra_int32_value() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->extra_int32_value(), output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:unittest_drop_unknown_fields.FooWithExtraFields)
}

::google::protobuf::uint8* FooWithExtraFields::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:unittest_drop_unknown_fields.FooWithExtraFields)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 int32_value = 1;
  if (this->int32_value() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->int32_value(), target);
  }

  // .unittest_drop_unknown_fields.FooWithExtraFields.NestedEnum enum_value = 2;
  if (this->enum_value() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      2, this->enum_value(), target);
  }

  // int32 extra_int32_value = 3;
  if (this->extra_int32_value() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->extra_int32_value(), target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:unittest_drop_unknown_fields.FooWithExtraFields)
  return target;
}

size_t FooWithExtraFields::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:unittest_drop_unknown_fields.FooWithExtraFields)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  // int32 int32_value = 1;
  if (this->int32_value() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->int32_value());
  }

  // .unittest_drop_unknown_fields.FooWithExtraFields.NestedEnum enum_value = 2;
  if (this->enum_value() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::EnumSize(this->enum_value());
  }

  // int32 extra_int32_value = 3;
  if (this->extra_int32_value() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->extra_int32_value());
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void FooWithExtraFields::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:unittest_drop_unknown_fields.FooWithExtraFields)
  GOOGLE_DCHECK_NE(&from, this);
  const FooWithExtraFields* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const FooWithExtraFields>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:unittest_drop_unknown_fields.FooWithExtraFields)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:unittest_drop_unknown_fields.FooWithExtraFields)
    MergeFrom(*source);
  }
}

void FooWithExtraFields::MergeFrom(const FooWithExtraFields& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:unittest_drop_unknown_fields.FooWithExtraFields)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.int32_value() != 0) {
    set_int32_value(from.int32_value());
  }
  if (from.enum_value() != 0) {
    set_enum_value(from.enum_value());
  }
  if (from.extra_int32_value() != 0) {
    set_extra_int32_value(from.extra_int32_value());
  }
}

void FooWithExtraFields::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:unittest_drop_unknown_fields.FooWithExtraFields)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void FooWithExtraFields::CopyFrom(const FooWithExtraFields& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:unittest_drop_unknown_fields.FooWithExtraFields)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool FooWithExtraFields::IsInitialized() const {
  return true;
}

void FooWithExtraFields::Swap(FooWithExtraFields* other) {
  if (other == this) return;
  InternalSwap(other);
}
void FooWithExtraFields::InternalSwap(FooWithExtraFields* other) {
  using std::swap;
  swap(int32_value_, other->int32_value_);
  swap(enum_value_, other->enum_value_);
  swap(extra_int32_value_, other->extra_int32_value_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata FooWithExtraFields::GetMetadata() const {
  protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2funittest_5fdrop_5funknown_5ffields_2eproto::file_level_metadata[kIndexInFileMessages];
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace unittest_drop_unknown_fields
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::unittest_drop_unknown_fields::Foo* Arena::CreateMaybeMessage< ::unittest_drop_unknown_fields::Foo >(Arena* arena) {
  return Arena::CreateInternal< ::unittest_drop_unknown_fields::Foo >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::unittest_drop_unknown_fields::FooWithExtraFields* Arena::CreateMaybeMessage< ::unittest_drop_unknown_fields::FooWithExtraFields >(Arena* arena) {
  return Arena::CreateInternal< ::unittest_drop_unknown_fields::FooWithExtraFields >(arena);
}
}  // namespace protobuf
}  // namespace google

// @@protoc_insertion_point(global_scope)
