diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 69ed85312d..d2deeadeda 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -5487,12 +5487,6 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto, } } -namespace { -bool IsAllowedReservedField(const FieldDescriptorProto& field) { - return false; -} -} // namespace - void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, Descriptor* parent, FieldDescriptor* result, @@ -5719,8 +5713,7 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, absl::Substitute("Field numbers cannot be greater than $0.", FieldDescriptor::kMaxNumber)); } else if (result->number() >= FieldDescriptor::kFirstReservedNumber && - result->number() <= FieldDescriptor::kLastReservedNumber && - !IsAllowedReservedField(proto)) { + result->number() <= FieldDescriptor::kLastReservedNumber) { message_hints_[parent].RequestHintOnFieldNumbers( proto, DescriptorPool::ErrorCollector::NUMBER); AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, @@ -8303,56 +8296,6 @@ void LazyDescriptor::Once(const ServiceDescriptor* service) { } } -// The format of this file is a sequence of lines like: -//