Future-proof edition 2023 against feature value support windows.

This "feature" hasn't been implemented yet, but this puts a placeholder down to prevent compatibility issues in future editions.  Once we provide versioning support on individual feature values, we don't want them becoming usable from edition 2023 protos

PiperOrigin-RevId: 635609614
editions-27
Mike Kruskal 9 months ago
parent d2da4636c0
commit fea6847e40
  1. 292
      src/google/protobuf/descriptor.pb.cc
  2. 127
      src/google/protobuf/descriptor.pb.h
  3. 3
      src/google/protobuf/descriptor.proto
  4. 16
      src/google/protobuf/feature_resolver.cc
  5. 23
      src/google/protobuf/feature_resolver_test.cc
  6. 7
      src/google/protobuf/unittest_features.proto
  7. 3
      upb/reflection/stage0/google/protobuf/descriptor.upb.c
  8. 28
      upb/reflection/stage0/google/protobuf/descriptor.upb.h

@ -662,6 +662,7 @@ inline constexpr EnumValueOptions::Impl_::Impl_(
: _cached_size_{0}, : _cached_size_{0},
uninterpreted_option_{}, uninterpreted_option_{},
features_{nullptr}, features_{nullptr},
feature_support_{nullptr},
deprecated_{false}, deprecated_{false},
debug_redact_{false} {} debug_redact_{false} {}
@ -1466,10 +1467,12 @@ const ::uint32_t
PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.deprecated_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.deprecated_),
PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.features_),
PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.debug_redact_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.debug_redact_),
PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.feature_support_),
PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.uninterpreted_option_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.uninterpreted_option_),
1,
0,
2, 2,
0,
3,
1,
~0u, ~0u,
PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _internal_metadata_),
@ -1662,18 +1665,18 @@ static const ::_pbi::MigrationSchema
{351, 373, -1, sizeof(::google::protobuf::FieldOptions)}, {351, 373, -1, sizeof(::google::protobuf::FieldOptions)},
{387, 397, -1, sizeof(::google::protobuf::OneofOptions)}, {387, 397, -1, sizeof(::google::protobuf::OneofOptions)},
{399, 412, -1, sizeof(::google::protobuf::EnumOptions)}, {399, 412, -1, sizeof(::google::protobuf::EnumOptions)},
{417, 429, -1, sizeof(::google::protobuf::EnumValueOptions)}, {417, 430, -1, sizeof(::google::protobuf::EnumValueOptions)},
{433, 444, -1, sizeof(::google::protobuf::ServiceOptions)}, {435, 446, -1, sizeof(::google::protobuf::ServiceOptions)},
{447, 459, -1, sizeof(::google::protobuf::MethodOptions)}, {449, 461, -1, sizeof(::google::protobuf::MethodOptions)},
{463, 473, -1, sizeof(::google::protobuf::UninterpretedOption_NamePart)}, {465, 475, -1, sizeof(::google::protobuf::UninterpretedOption_NamePart)},
{475, 490, -1, sizeof(::google::protobuf::UninterpretedOption)}, {477, 492, -1, sizeof(::google::protobuf::UninterpretedOption)},
{497, 511, -1, sizeof(::google::protobuf::FeatureSet)}, {499, 513, -1, sizeof(::google::protobuf::FeatureSet)},
{517, 528, -1, sizeof(::google::protobuf::FeatureSetDefaults_FeatureSetEditionDefault)}, {519, 530, -1, sizeof(::google::protobuf::FeatureSetDefaults_FeatureSetEditionDefault)},
{531, 542, -1, sizeof(::google::protobuf::FeatureSetDefaults)}, {533, 544, -1, sizeof(::google::protobuf::FeatureSetDefaults)},
{545, 558, -1, sizeof(::google::protobuf::SourceCodeInfo_Location)}, {547, 560, -1, sizeof(::google::protobuf::SourceCodeInfo_Location)},
{563, -1, -1, sizeof(::google::protobuf::SourceCodeInfo)}, {565, -1, -1, sizeof(::google::protobuf::SourceCodeInfo)},
{572, 585, -1, sizeof(::google::protobuf::GeneratedCodeInfo_Annotation)}, {574, 587, -1, sizeof(::google::protobuf::GeneratedCodeInfo_Annotation)},
{590, -1, -1, sizeof(::google::protobuf::GeneratedCodeInfo)}, {592, -1, -1, sizeof(::google::protobuf::GeneratedCodeInfo)},
}; };
static const ::_pb::Message* const file_default_instances[] = { static const ::_pb::Message* const file_default_instances[] = {
&::google::protobuf::_FileDescriptorSet_default_instance_._instance, &::google::protobuf::_FileDescriptorSet_default_instance_._instance,
@ -1872,103 +1875,105 @@ const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] AB
"cts\030\006 \001(\010B\002\030\001\022-\n\010features\030\007 \001(\0132\033.google" "cts\030\006 \001(\010B\002\030\001\022-\n\010features\030\007 \001(\0132\033.google"
".protobuf.FeatureSet\022C\n\024uninterpreted_op" ".protobuf.FeatureSet\022C\n\024uninterpreted_op"
"tion\030\347\007 \003(\0132$.google.protobuf.Uninterpre" "tion\030\347\007 \003(\0132$.google.protobuf.Uninterpre"
"tedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006\"\311\001\n\020EnumValue" "tedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006\"\220\002\n\020EnumValue"
"Options\022\031\n\ndeprecated\030\001 \001(\010:\005false\022-\n\010fe" "Options\022\031\n\ndeprecated\030\001 \001(\010:\005false\022-\n\010fe"
"atures\030\002 \001(\0132\033.google.protobuf.FeatureSe" "atures\030\002 \001(\0132\033.google.protobuf.FeatureSe"
"t\022\033\n\014debug_redact\030\003 \001(\010:\005false\022C\n\024uninte" "t\022\033\n\014debug_redact\030\003 \001(\010:\005false\022E\n\017featur"
"rpreted_option\030\347\007 \003(\0132$.google.protobuf." "e_support\030\004 \001(\0132,.google.protobuf.FieldO"
"UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\252\001\n\016Servi" "ptions.FeatureSupport\022C\n\024uninterpreted_o"
"ceOptions\022-\n\010features\030\" \001(\0132\033.google.pro" "ption\030\347\007 \003(\0132$.google.protobuf.Uninterpr"
"tobuf.FeatureSet\022\031\n\ndeprecated\030! \001(\010:\005fa" "etedOption*\t\010\350\007\020\200\200\200\200\002\"\252\001\n\016ServiceOptions"
"lse\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goo" "\022-\n\010features\030\" \001(\0132\033.google.protobuf.Fea"
"gle.protobuf.UninterpretedOption*\t\010\350\007\020\200\200" "tureSet\022\031\n\ndeprecated\030! \001(\010:\005false\022C\n\024un"
"\200\200\002\"\334\002\n\rMethodOptions\022\031\n\ndeprecated\030! \001(" "interpreted_option\030\347\007 \003(\0132$.google.proto"
"\010:\005false\022_\n\021idempotency_level\030\" \001(\0162/.go" "buf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\334\002\n\rM"
"ogle.protobuf.MethodOptions.IdempotencyL" "ethodOptions\022\031\n\ndeprecated\030! \001(\010:\005false\022"
"evel:\023IDEMPOTENCY_UNKNOWN\022-\n\010features\030# " "_\n\021idempotency_level\030\" \001(\0162/.google.prot"
"\001(\0132\033.google.protobuf.FeatureSet\022C\n\024unin" "obuf.MethodOptions.IdempotencyLevel:\023IDE"
"terpreted_option\030\347\007 \003(\0132$.google.protobu" "MPOTENCY_UNKNOWN\022-\n\010features\030# \001(\0132\033.goo"
"f.UninterpretedOption\"P\n\020IdempotencyLeve" "gle.protobuf.FeatureSet\022C\n\024uninterpreted"
"l\022\027\n\023IDEMPOTENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_EF" "_option\030\347\007 \003(\0132$.google.protobuf.Uninter"
"FECTS\020\001\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023U" "pretedOption\"P\n\020IdempotencyLevel\022\027\n\023IDEM"
"ninterpretedOption\022;\n\004name\030\002 \003(\0132-.googl" "POTENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_EFFECTS\020\001\022\016"
"e.protobuf.UninterpretedOption.NamePart\022" "\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023Uninterpre"
"\030\n\020identifier_value\030\003 \001(\t\022\032\n\022positive_in" "tedOption\022;\n\004name\030\002 \003(\0132-.google.protobu"
"t_value\030\004 \001(\004\022\032\n\022negative_int_value\030\005 \001(" "f.UninterpretedOption.NamePart\022\030\n\020identi"
"\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014string_value\030" "fier_value\030\003 \001(\t\022\032\n\022positive_int_value\030\004"
"\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\0323\n\010NamePa" " \001(\004\022\032\n\022negative_int_value\030\005 \001(\003\022\024\n\014doub"
"rt\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_extension\030\002 " "le_value\030\006 \001(\001\022\024\n\014string_value\030\007 \001(\014\022\027\n\017"
"\002(\010\"\311\t\n\nFeatureSet\022\202\001\n\016field_presence\030\001 " "aggregate_value\030\010 \001(\t\0323\n\010NamePart\022\021\n\tnam"
"\001(\0162).google.protobuf.FeatureSet.FieldPr" "e_part\030\001 \002(\t\022\024\n\014is_extension\030\002 \002(\010\"\311\t\n\nF"
"esenceB\?\210\001\001\230\001\004\230\001\001\242\001\r\022\010EXPLICIT\030\346\007\242\001\r\022\010IM" "eatureSet\022\202\001\n\016field_presence\030\001 \001(\0162).goo"
"PLICIT\030\347\007\242\001\r\022\010EXPLICIT\030\350\007\262\001\003\010\350\007\022b\n\tenum_" "gle.protobuf.FeatureSet.FieldPresenceB\?\210"
"type\030\002 \001(\0162$.google.protobuf.FeatureSet." "\001\001\230\001\004\230\001\001\242\001\r\022\010EXPLICIT\030\346\007\242\001\r\022\010IMPLICIT\030\347\007"
"EnumTypeB)\210\001\001\230\001\006\230\001\001\242\001\013\022\006CLOSED\030\346\007\242\001\t\022\004OP" "\242\001\r\022\010EXPLICIT\030\350\007\262\001\003\010\350\007\022b\n\tenum_type\030\002 \001("
"EN\030\347\007\262\001\003\010\350\007\022\201\001\n\027repeated_field_encoding\030" "\0162$.google.protobuf.FeatureSet.EnumTypeB"
"\003 \001(\01621.google.protobuf.FeatureSet.Repea" ")\210\001\001\230\001\006\230\001\001\242\001\013\022\006CLOSED\030\346\007\242\001\t\022\004OPEN\030\347\007\262\001\003\010"
"tedFieldEncodingB-\210\001\001\230\001\004\230\001\001\242\001\r\022\010EXPANDED" "\350\007\022\201\001\n\027repeated_field_encoding\030\003 \001(\01621.g"
"\030\346\007\242\001\013\022\006PACKED\030\347\007\262\001\003\010\350\007\022n\n\017utf8_validati" "oogle.protobuf.FeatureSet.RepeatedFieldE"
"on\030\004 \001(\0162*.google.protobuf.FeatureSet.Ut" "ncodingB-\210\001\001\230\001\004\230\001\001\242\001\r\022\010EXPANDED\030\346\007\242\001\013\022\006P"
"f8ValidationB)\210\001\001\230\001\004\230\001\001\242\001\t\022\004NONE\030\346\007\242\001\013\022\006" "ACKED\030\347\007\262\001\003\010\350\007\022n\n\017utf8_validation\030\004 \001(\0162"
"VERIFY\030\347\007\262\001\003\010\350\007\022m\n\020message_encoding\030\005 \001(" "*.google.protobuf.FeatureSet.Utf8Validat"
"\0162+.google.protobuf.FeatureSet.MessageEn" "ionB)\210\001\001\230\001\004\230\001\001\242\001\t\022\004NONE\030\346\007\242\001\013\022\006VERIFY\030\347\007"
"codingB&\210\001\001\230\001\004\230\001\001\242\001\024\022\017LENGTH_PREFIXED\030\346\007" "\262\001\003\010\350\007\022m\n\020message_encoding\030\005 \001(\0162+.googl"
"\262\001\003\010\350\007\022v\n\013json_format\030\006 \001(\0162&.google.pro" "e.protobuf.FeatureSet.MessageEncodingB&\210"
"tobuf.FeatureSet.JsonFormatB9\210\001\001\230\001\003\230\001\006\230\001" "\001\001\230\001\004\230\001\001\242\001\024\022\017LENGTH_PREFIXED\030\346\007\262\001\003\010\350\007\022v\n"
"\001\242\001\027\022\022LEGACY_BEST_EFFORT\030\346\007\242\001\n\022\005ALLOW\030\347\007" "\013json_format\030\006 \001(\0162&.google.protobuf.Fea"
"\262\001\003\010\350\007\"\\\n\rFieldPresence\022\032\n\026FIELD_PRESENC" "tureSet.JsonFormatB9\210\001\001\230\001\003\230\001\006\230\001\001\242\001\027\022\022LEG"
"E_UNKNOWN\020\000\022\014\n\010EXPLICIT\020\001\022\014\n\010IMPLICIT\020\002\022" "ACY_BEST_EFFORT\030\346\007\242\001\n\022\005ALLOW\030\347\007\262\001\003\010\350\007\"\\\n"
"\023\n\017LEGACY_REQUIRED\020\003\"7\n\010EnumType\022\025\n\021ENUM" "\rFieldPresence\022\032\n\026FIELD_PRESENCE_UNKNOWN"
"_TYPE_UNKNOWN\020\000\022\010\n\004OPEN\020\001\022\n\n\006CLOSED\020\002\"V\n" "\020\000\022\014\n\010EXPLICIT\020\001\022\014\n\010IMPLICIT\020\002\022\023\n\017LEGACY"
"\025RepeatedFieldEncoding\022#\n\037REPEATED_FIELD" "_REQUIRED\020\003\"7\n\010EnumType\022\025\n\021ENUM_TYPE_UNK"
"_ENCODING_UNKNOWN\020\000\022\n\n\006PACKED\020\001\022\014\n\010EXPAN" "NOWN\020\000\022\010\n\004OPEN\020\001\022\n\n\006CLOSED\020\002\"V\n\025Repeated"
"DED\020\002\"I\n\016Utf8Validation\022\033\n\027UTF8_VALIDATI" "FieldEncoding\022#\n\037REPEATED_FIELD_ENCODING"
"ON_UNKNOWN\020\000\022\n\n\006VERIFY\020\002\022\010\n\004NONE\020\003\"\004\010\001\020\001" "_UNKNOWN\020\000\022\n\n\006PACKED\020\001\022\014\n\010EXPANDED\020\002\"I\n\016"
"\"S\n\017MessageEncoding\022\034\n\030MESSAGE_ENCODING_" "Utf8Validation\022\033\n\027UTF8_VALIDATION_UNKNOW"
"UNKNOWN\020\000\022\023\n\017LENGTH_PREFIXED\020\001\022\r\n\tDELIMI" "N\020\000\022\n\n\006VERIFY\020\002\022\010\n\004NONE\020\003\"\004\010\001\020\001\"S\n\017Messa"
"TED\020\002\"H\n\nJsonFormat\022\027\n\023JSON_FORMAT_UNKNO" "geEncoding\022\034\n\030MESSAGE_ENCODING_UNKNOWN\020\000"
"WN\020\000\022\t\n\005ALLOW\020\001\022\026\n\022LEGACY_BEST_EFFORT\020\002*" "\022\023\n\017LENGTH_PREFIXED\020\001\022\r\n\tDELIMITED\020\002\"H\n\n"
"\006\010\350\007\020\213N*\006\010\213N\020\220N*\006\010\220N\020\221NJ\006\010\347\007\020\350\007\"\230\003\n\022Feat" "JsonFormat\022\027\n\023JSON_FORMAT_UNKNOWN\020\000\022\t\n\005A"
"ureSetDefaults\022N\n\010defaults\030\001 \003(\0132<.googl" "LLOW\020\001\022\026\n\022LEGACY_BEST_EFFORT\020\002*\006\010\350\007\020\213N*\006"
"e.protobuf.FeatureSetDefaults.FeatureSet" "\010\213N\020\220N*\006\010\220N\020\221NJ\006\010\347\007\020\350\007\"\230\003\n\022FeatureSetDef"
"EditionDefault\0221\n\017minimum_edition\030\004 \001(\0162" "aults\022N\n\010defaults\030\001 \003(\0132<.google.protobu"
"\030.google.protobuf.Edition\0221\n\017maximum_edi" "f.FeatureSetDefaults.FeatureSetEditionDe"
"tion\030\005 \001(\0162\030.google.protobuf.Edition\032\313\001\n" "fault\0221\n\017minimum_edition\030\004 \001(\0162\030.google."
"\030FeatureSetEditionDefault\022)\n\007edition\030\003 \001" "protobuf.Edition\0221\n\017maximum_edition\030\005 \001("
"(\0162\030.google.protobuf.Edition\0229\n\024overrida" "\0162\030.google.protobuf.Edition\032\313\001\n\030FeatureS"
"ble_features\030\004 \001(\0132\033.google.protobuf.Fea" "etEditionDefault\022)\n\007edition\030\003 \001(\0162\030.goog"
"tureSet\0223\n\016fixed_features\030\005 \001(\0132\033.google" "le.protobuf.Edition\0229\n\024overridable_featu"
".protobuf.FeatureSetJ\004\010\001\020\002J\004\010\002\020\003R\010featur" "res\030\004 \001(\0132\033.google.protobuf.FeatureSet\0223"
"es\"\325\001\n\016SourceCodeInfo\022:\n\010location\030\001 \003(\0132" "\n\016fixed_features\030\005 \001(\0132\033.google.protobuf"
"(.google.protobuf.SourceCodeInfo.Locatio" ".FeatureSetJ\004\010\001\020\002J\004\010\002\020\003R\010features\"\325\001\n\016So"
"n\032\206\001\n\010Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span" "urceCodeInfo\022:\n\010location\030\001 \003(\0132(.google."
"\030\002 \003(\005B\002\020\001\022\030\n\020leading_comments\030\003 \001(\t\022\031\n\021" "protobuf.SourceCodeInfo.Location\032\206\001\n\010Loc"
"trailing_comments\030\004 \001(\t\022!\n\031leading_detac" "ation\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020"
"hed_comments\030\006 \003(\t\"\234\002\n\021GeneratedCodeInfo" "\001\022\030\n\020leading_comments\030\003 \001(\t\022\031\n\021trailing_"
"\022A\n\nannotation\030\001 \003(\0132-.google.protobuf.G" "comments\030\004 \001(\t\022!\n\031leading_detached_comme"
"eneratedCodeInfo.Annotation\032\303\001\n\nAnnotati" "nts\030\006 \003(\t\"\234\002\n\021GeneratedCodeInfo\022A\n\nannot"
"on\022\020\n\004path\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001(" "ation\030\001 \003(\0132-.google.protobuf.GeneratedC"
"\t\022\r\n\005begin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005\022H\n\010semanti" "odeInfo.Annotation\032\303\001\n\nAnnotation\022\020\n\004pat"
"c\030\005 \001(\01626.google.protobuf.GeneratedCodeI" "h\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005begi"
"nfo.Annotation.Semantic\"(\n\010Semantic\022\010\n\004N" "n\030\003 \001(\005\022\013\n\003end\030\004 \001(\005\022H\n\010semantic\030\005 \001(\01626"
"ONE\020\000\022\007\n\003SET\020\001\022\t\n\005ALIAS\020\002*\247\002\n\007Edition\022\023\n" ".google.protobuf.GeneratedCodeInfo.Annot"
"\017EDITION_UNKNOWN\020\000\022\023\n\016EDITION_LEGACY\020\204\007\022" "ation.Semantic\"(\n\010Semantic\022\010\n\004NONE\020\000\022\007\n\003"
"\023\n\016EDITION_PROTO2\020\346\007\022\023\n\016EDITION_PROTO3\020\347" "SET\020\001\022\t\n\005ALIAS\020\002*\247\002\n\007Edition\022\023\n\017EDITION_"
"\007\022\021\n\014EDITION_2023\020\350\007\022\021\n\014EDITION_2024\020\351\007\022" "UNKNOWN\020\000\022\023\n\016EDITION_LEGACY\020\204\007\022\023\n\016EDITIO"
"\027\n\023EDITION_1_TEST_ONLY\020\001\022\027\n\023EDITION_2_TE" "N_PROTO2\020\346\007\022\023\n\016EDITION_PROTO3\020\347\007\022\021\n\014EDIT"
"ST_ONLY\020\002\022\035\n\027EDITION_99997_TEST_ONLY\020\235\215\006" "ION_2023\020\350\007\022\021\n\014EDITION_2024\020\351\007\022\027\n\023EDITIO"
"\022\035\n\027EDITION_99998_TEST_ONLY\020\236\215\006\022\035\n\027EDITI" "N_1_TEST_ONLY\020\001\022\027\n\023EDITION_2_TEST_ONLY\020\002"
"ON_99999_TEST_ONLY\020\237\215\006\022\023\n\013EDITION_MAX\020\377\377" "\022\035\n\027EDITION_99997_TEST_ONLY\020\235\215\006\022\035\n\027EDITI"
"\377\377\007B~\n\023com.google.protobufB\020DescriptorPr" "ON_99998_TEST_ONLY\020\236\215\006\022\035\n\027EDITION_99999_"
"otosH\001Z-google.golang.org/protobuf/types" "TEST_ONLY\020\237\215\006\022\023\n\013EDITION_MAX\020\377\377\377\377\007B~\n\023co"
"/descriptorpb\370\001\001\242\002\003GPB\252\002\032Google.Protobuf" "m.google.protobufB\020DescriptorProtosH\001Z-g"
".Reflection" "oogle.golang.org/protobuf/types/descript"
"orpb\370\001\001\242\002\003GPB\252\002\032Google.Protobuf.Reflecti"
"on"
}; };
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once; static ::absl::once_flag descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once;
PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto = { PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto = {
false, false,
false, false,
10011, 10082,
descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto, descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto,
"google/protobuf/descriptor.proto", "google/protobuf/descriptor.proto",
&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
@ -10210,6 +10215,9 @@ EnumValueOptions::EnumValueOptions(
_impl_.features_ = (cached_has_bits & 0x00000001u) ? ::google::protobuf::Message::CopyConstruct<::google::protobuf::FeatureSet>( _impl_.features_ = (cached_has_bits & 0x00000001u) ? ::google::protobuf::Message::CopyConstruct<::google::protobuf::FeatureSet>(
arena, *from._impl_.features_) arena, *from._impl_.features_)
: nullptr; : nullptr;
_impl_.feature_support_ = (cached_has_bits & 0x00000002u) ? ::google::protobuf::Message::CopyConstruct<::google::protobuf::FieldOptions_FeatureSupport>(
arena, *from._impl_.feature_support_)
: nullptr;
::memcpy(reinterpret_cast<char *>(&_impl_) + ::memcpy(reinterpret_cast<char *>(&_impl_) +
offsetof(Impl_, deprecated_), offsetof(Impl_, deprecated_),
reinterpret_cast<const char *>(&from._impl_) + reinterpret_cast<const char *>(&from._impl_) +
@ -10244,6 +10252,7 @@ EnumValueOptions::~EnumValueOptions() {
inline void EnumValueOptions::SharedDtor() { inline void EnumValueOptions::SharedDtor() {
ABSL_DCHECK(GetArena() == nullptr); ABSL_DCHECK(GetArena() == nullptr);
delete _impl_.features_; delete _impl_.features_;
delete _impl_.feature_support_;
_impl_.~Impl_(); _impl_.~Impl_();
} }
@ -10267,16 +10276,16 @@ EnumValueOptions::GetClassData() const {
::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table);
return _data_.base(); return _data_.base();
} }
constexpr ::_pbi::TcParseTable<3, 4, 2, 0, 7> EnumValueOptions::_table_ = { constexpr ::_pbi::TcParseTable<3, 5, 3, 0, 7> EnumValueOptions::_table_ = {
{ {
PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_._extensions_), PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_._extensions_),
999, 56, // max_field_number, fast_idx_mask 999, 56, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table), offsetof(decltype(_table_), field_lookup_table),
4294967288, // skipmap 4294967280, // skipmap
offsetof(decltype(_table_), field_entries), offsetof(decltype(_table_), field_entries),
4, // num_field_entries 5, // num_field_entries
2, // num_aux_entries 3, // num_aux_entries
offsetof(decltype(_table_), aux_entries), offsetof(decltype(_table_), aux_entries),
&_EnumValueOptions_default_instance_._instance, &_EnumValueOptions_default_instance_._instance,
nullptr, // post_loop_handler nullptr, // post_loop_handler
@ -10287,39 +10296,45 @@ constexpr ::_pbi::TcParseTable<3, 4, 2, 0, 7> EnumValueOptions::_table_ = {
}, {{ }, {{
{::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}},
// optional bool deprecated = 1 [default = false]; // optional bool deprecated = 1 [default = false];
{::_pbi::TcParser::SingularVarintNoZag1<bool, offsetof(EnumValueOptions, _impl_.deprecated_), 1>(), {::_pbi::TcParser::SingularVarintNoZag1<bool, offsetof(EnumValueOptions, _impl_.deprecated_), 2>(),
{8, 1, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_)}}, {8, 2, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_)}},
// optional .google.protobuf.FeatureSet features = 2; // optional .google.protobuf.FeatureSet features = 2;
{::_pbi::TcParser::FastMtS1, {::_pbi::TcParser::FastMtS1,
{18, 0, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.features_)}}, {18, 0, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.features_)}},
// optional bool debug_redact = 3 [default = false]; // optional bool debug_redact = 3 [default = false];
{::_pbi::TcParser::SingularVarintNoZag1<bool, offsetof(EnumValueOptions, _impl_.debug_redact_), 2>(), {::_pbi::TcParser::SingularVarintNoZag1<bool, offsetof(EnumValueOptions, _impl_.debug_redact_), 3>(),
{24, 2, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_)}}, {24, 3, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_)}},
{::_pbi::TcParser::MiniParse, {}}, // optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4;
{::_pbi::TcParser::FastMtS1,
{34, 1, 1, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.feature_support_)}},
{::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}},
{::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}},
// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
{::_pbi::TcParser::FastMtR2, {::_pbi::TcParser::FastMtR2,
{16058, 63, 1, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.uninterpreted_option_)}}, {16058, 63, 2, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.uninterpreted_option_)}},
}}, {{ }}, {{
999, 0, 1, 999, 0, 1,
65534, 3, 65534, 4,
65535, 65535 65535, 65535
}}, {{ }}, {{
// optional bool deprecated = 1 [default = false]; // optional bool deprecated = 1 [default = false];
{PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 1, 0, {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 2, 0,
(0 | ::_fl::kFcOptional | ::_fl::kBool)}, (0 | ::_fl::kFcOptional | ::_fl::kBool)},
// optional .google.protobuf.FeatureSet features = 2; // optional .google.protobuf.FeatureSet features = 2;
{PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 0, {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 0,
(0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
// optional bool debug_redact = 3 [default = false]; // optional bool debug_redact = 3 [default = false];
{PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_), _Internal::kHasBitsOffset + 2, 0, {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_), _Internal::kHasBitsOffset + 3, 0,
(0 | ::_fl::kFcOptional | ::_fl::kBool)}, (0 | ::_fl::kFcOptional | ::_fl::kBool)},
// optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4;
{PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.feature_support_), _Internal::kHasBitsOffset + 1, 1,
(0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
{PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.uninterpreted_option_), -1, 1, {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.uninterpreted_option_), -1, 2,
(0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
}}, {{ }}, {{
{::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()},
{::_pbi::TcParser::GetTable<::google::protobuf::FieldOptions_FeatureSupport>()},
{::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()},
}}, {{ }}, {{
}}, }},
@ -10335,10 +10350,16 @@ PROTOBUF_NOINLINE void EnumValueOptions::Clear() {
_impl_._extensions_.Clear(); _impl_._extensions_.Clear();
_impl_.uninterpreted_option_.Clear(); _impl_.uninterpreted_option_.Clear();
cached_has_bits = _impl_._has_bits_[0]; cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) { if (cached_has_bits & 0x00000001u) {
ABSL_DCHECK(_impl_.features_ != nullptr); ABSL_DCHECK(_impl_.features_ != nullptr);
_impl_.features_->Clear(); _impl_.features_->Clear();
} }
if (cached_has_bits & 0x00000002u) {
ABSL_DCHECK(_impl_.feature_support_ != nullptr);
_impl_.feature_support_->Clear();
}
}
::memset(&_impl_.deprecated_, 0, static_cast<::size_t>( ::memset(&_impl_.deprecated_, 0, static_cast<::size_t>(
reinterpret_cast<char*>(&_impl_.debug_redact_) - reinterpret_cast<char*>(&_impl_.debug_redact_) -
reinterpret_cast<char*>(&_impl_.deprecated_)) + sizeof(_impl_.debug_redact_)); reinterpret_cast<char*>(&_impl_.deprecated_)) + sizeof(_impl_.debug_redact_));
@ -10355,7 +10376,7 @@ PROTOBUF_NOINLINE void EnumValueOptions::Clear() {
cached_has_bits = _impl_._has_bits_[0]; cached_has_bits = _impl_._has_bits_[0];
// optional bool deprecated = 1 [default = false]; // optional bool deprecated = 1 [default = false];
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray( target = ::_pbi::WireFormatLite::WriteBoolToArray(
1, this->_internal_deprecated(), target); 1, this->_internal_deprecated(), target);
@ -10368,12 +10389,18 @@ PROTOBUF_NOINLINE void EnumValueOptions::Clear() {
} }
// optional bool debug_redact = 3 [default = false]; // optional bool debug_redact = 3 [default = false];
if (cached_has_bits & 0x00000004u) { if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target); target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray( target = ::_pbi::WireFormatLite::WriteBoolToArray(
3, this->_internal_debug_redact(), target); 3, this->_internal_debug_redact(), target);
} }
// optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4;
if (cached_has_bits & 0x00000002u) {
target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
4, *_impl_.feature_support_, _impl_.feature_support_->GetCachedSize(), target, stream);
}
// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
for (unsigned i = 0, n = static_cast<unsigned>( for (unsigned i = 0, n = static_cast<unsigned>(
this->_internal_uninterpreted_option_size()); this->_internal_uninterpreted_option_size());
@ -10414,20 +10441,24 @@ PROTOBUF_NOINLINE void EnumValueOptions::Clear() {
total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
} }
cached_has_bits = _impl_._has_bits_[0]; cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x0000000fu) {
// optional .google.protobuf.FeatureSet features = 2; // optional .google.protobuf.FeatureSet features = 2;
if (cached_has_bits & 0x00000001u) { if (cached_has_bits & 0x00000001u) {
total_size += total_size +=
1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.features_); 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.features_);
} }
// optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4;
// optional bool deprecated = 1 [default = false];
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000002u) {
total_size +=
1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.feature_support_);
}
// optional bool deprecated = 1 [default = false];
if (cached_has_bits & 0x00000004u) {
total_size += 2; total_size += 2;
} }
// optional bool debug_redact = 3 [default = false]; // optional bool debug_redact = 3 [default = false];
if (cached_has_bits & 0x00000004u) { if (cached_has_bits & 0x00000008u) {
total_size += 2; total_size += 2;
} }
@ -10448,7 +10479,7 @@ void EnumValueOptions::MergeImpl(::google::protobuf::MessageLite& to_msg, const
_this->_internal_mutable_uninterpreted_option()->MergeFrom( _this->_internal_mutable_uninterpreted_option()->MergeFrom(
from._internal_uninterpreted_option()); from._internal_uninterpreted_option());
cached_has_bits = from._impl_._has_bits_[0]; cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x0000000fu) {
if (cached_has_bits & 0x00000001u) { if (cached_has_bits & 0x00000001u) {
ABSL_DCHECK(from._impl_.features_ != nullptr); ABSL_DCHECK(from._impl_.features_ != nullptr);
if (_this->_impl_.features_ == nullptr) { if (_this->_impl_.features_ == nullptr) {
@ -10459,9 +10490,18 @@ void EnumValueOptions::MergeImpl(::google::protobuf::MessageLite& to_msg, const
} }
} }
if (cached_has_bits & 0x00000002u) { if (cached_has_bits & 0x00000002u) {
_this->_impl_.deprecated_ = from._impl_.deprecated_; ABSL_DCHECK(from._impl_.feature_support_ != nullptr);
if (_this->_impl_.feature_support_ == nullptr) {
_this->_impl_.feature_support_ =
::google::protobuf::Message::CopyConstruct<::google::protobuf::FieldOptions_FeatureSupport>(arena, *from._impl_.feature_support_);
} else {
_this->_impl_.feature_support_->MergeFrom(*from._impl_.feature_support_);
}
} }
if (cached_has_bits & 0x00000004u) { if (cached_has_bits & 0x00000004u) {
_this->_impl_.deprecated_ = from._impl_.deprecated_;
}
if (cached_has_bits & 0x00000008u) {
_this->_impl_.debug_redact_ = from._impl_.debug_redact_; _this->_impl_.debug_redact_ = from._impl_.debug_redact_;
} }
} }

@ -7616,6 +7616,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : public ::google::protobuf::Messag
enum : int { enum : int {
kUninterpretedOptionFieldNumber = 999, kUninterpretedOptionFieldNumber = 999,
kFeaturesFieldNumber = 2, kFeaturesFieldNumber = 2,
kFeatureSupportFieldNumber = 4,
kDeprecatedFieldNumber = 1, kDeprecatedFieldNumber = 1,
kDebugRedactFieldNumber = 3, kDebugRedactFieldNumber = 3,
}; };
@ -7650,6 +7651,21 @@ class PROTOBUF_EXPORT EnumValueOptions final : public ::google::protobuf::Messag
const ::google::protobuf::FeatureSet& _internal_features() const; const ::google::protobuf::FeatureSet& _internal_features() const;
::google::protobuf::FeatureSet* _internal_mutable_features(); ::google::protobuf::FeatureSet* _internal_mutable_features();
public:
// optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4;
bool has_feature_support() const;
void clear_feature_support() ;
const ::google::protobuf::FieldOptions_FeatureSupport& feature_support() const;
PROTOBUF_NODISCARD ::google::protobuf::FieldOptions_FeatureSupport* release_feature_support();
::google::protobuf::FieldOptions_FeatureSupport* mutable_feature_support();
void set_allocated_feature_support(::google::protobuf::FieldOptions_FeatureSupport* value);
void unsafe_arena_set_allocated_feature_support(::google::protobuf::FieldOptions_FeatureSupport* value);
::google::protobuf::FieldOptions_FeatureSupport* unsafe_arena_release_feature_support();
private:
const ::google::protobuf::FieldOptions_FeatureSupport& _internal_feature_support() const;
::google::protobuf::FieldOptions_FeatureSupport* _internal_mutable_feature_support();
public: public:
// optional bool deprecated = 1 [default = false]; // optional bool deprecated = 1 [default = false];
bool has_deprecated() const; bool has_deprecated() const;
@ -7857,7 +7873,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : public ::google::protobuf::Messag
class _Internal; class _Internal;
friend class ::google::protobuf::internal::TcParser; friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable< static const ::google::protobuf::internal::TcParseTable<
3, 4, 2, 3, 5, 3,
0, 7> 0, 7>
_table_; _table_;
@ -7883,6 +7899,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : public ::google::protobuf::Messag
mutable ::google::protobuf::internal::CachedSize _cached_size_; mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;
::google::protobuf::FeatureSet* features_; ::google::protobuf::FeatureSet* features_;
::google::protobuf::FieldOptions_FeatureSupport* feature_support_;
bool deprecated_; bool deprecated_;
bool debug_redact_; bool debug_redact_;
PROTOBUF_TSAN_DECLARE_MEMBER PROTOBUF_TSAN_DECLARE_MEMBER
@ -17868,13 +17885,13 @@ EnumOptions::_internal_mutable_uninterpreted_option() {
// optional bool deprecated = 1 [default = false]; // optional bool deprecated = 1 [default = false];
inline bool EnumValueOptions::has_deprecated() const { inline bool EnumValueOptions::has_deprecated() const {
bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
return value; return value;
} }
inline void EnumValueOptions::clear_deprecated() { inline void EnumValueOptions::clear_deprecated() {
::google::protobuf::internal::TSanWrite(&_impl_); ::google::protobuf::internal::TSanWrite(&_impl_);
_impl_.deprecated_ = false; _impl_.deprecated_ = false;
_impl_._has_bits_[0] &= ~0x00000002u; _impl_._has_bits_[0] &= ~0x00000004u;
} }
inline bool EnumValueOptions::deprecated() const { inline bool EnumValueOptions::deprecated() const {
// @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated) // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated)
@ -17882,7 +17899,7 @@ inline bool EnumValueOptions::deprecated() const {
} }
inline void EnumValueOptions::set_deprecated(bool value) { inline void EnumValueOptions::set_deprecated(bool value) {
_internal_set_deprecated(value); _internal_set_deprecated(value);
_impl_._has_bits_[0] |= 0x00000002u; _impl_._has_bits_[0] |= 0x00000004u;
// @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.deprecated) // @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.deprecated)
} }
inline bool EnumValueOptions::_internal_deprecated() const { inline bool EnumValueOptions::_internal_deprecated() const {
@ -17992,13 +18009,13 @@ inline void EnumValueOptions::set_allocated_features(::google::protobuf::Feature
// optional bool debug_redact = 3 [default = false]; // optional bool debug_redact = 3 [default = false];
inline bool EnumValueOptions::has_debug_redact() const { inline bool EnumValueOptions::has_debug_redact() const {
bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0;
return value; return value;
} }
inline void EnumValueOptions::clear_debug_redact() { inline void EnumValueOptions::clear_debug_redact() {
::google::protobuf::internal::TSanWrite(&_impl_); ::google::protobuf::internal::TSanWrite(&_impl_);
_impl_.debug_redact_ = false; _impl_.debug_redact_ = false;
_impl_._has_bits_[0] &= ~0x00000004u; _impl_._has_bits_[0] &= ~0x00000008u;
} }
inline bool EnumValueOptions::debug_redact() const { inline bool EnumValueOptions::debug_redact() const {
// @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.debug_redact) // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.debug_redact)
@ -18006,7 +18023,7 @@ inline bool EnumValueOptions::debug_redact() const {
} }
inline void EnumValueOptions::set_debug_redact(bool value) { inline void EnumValueOptions::set_debug_redact(bool value) {
_internal_set_debug_redact(value); _internal_set_debug_redact(value);
_impl_._has_bits_[0] |= 0x00000004u; _impl_._has_bits_[0] |= 0x00000008u;
// @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.debug_redact) // @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.debug_redact)
} }
inline bool EnumValueOptions::_internal_debug_redact() const { inline bool EnumValueOptions::_internal_debug_redact() const {
@ -18018,6 +18035,102 @@ inline void EnumValueOptions::_internal_set_debug_redact(bool value) {
_impl_.debug_redact_ = value; _impl_.debug_redact_ = value;
} }
// optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4;
inline bool EnumValueOptions::has_feature_support() const {
bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
PROTOBUF_ASSUME(!value || _impl_.feature_support_ != nullptr);
return value;
}
inline void EnumValueOptions::clear_feature_support() {
::google::protobuf::internal::TSanWrite(&_impl_);
if (_impl_.feature_support_ != nullptr) _impl_.feature_support_->Clear();
_impl_._has_bits_[0] &= ~0x00000002u;
}
inline const ::google::protobuf::FieldOptions_FeatureSupport& EnumValueOptions::_internal_feature_support() const {
::google::protobuf::internal::TSanRead(&_impl_);
const ::google::protobuf::FieldOptions_FeatureSupport* p = _impl_.feature_support_;
return p != nullptr ? *p : reinterpret_cast<const ::google::protobuf::FieldOptions_FeatureSupport&>(::google::protobuf::_FieldOptions_FeatureSupport_default_instance_);
}
inline const ::google::protobuf::FieldOptions_FeatureSupport& EnumValueOptions::feature_support() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
// @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.feature_support)
return _internal_feature_support();
}
inline void EnumValueOptions::unsafe_arena_set_allocated_feature_support(::google::protobuf::FieldOptions_FeatureSupport* value) {
::google::protobuf::internal::TSanWrite(&_impl_);
if (GetArena() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.feature_support_);
}
_impl_.feature_support_ = reinterpret_cast<::google::protobuf::FieldOptions_FeatureSupport*>(value);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000002u;
} else {
_impl_._has_bits_[0] &= ~0x00000002u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueOptions.feature_support)
}
inline ::google::protobuf::FieldOptions_FeatureSupport* EnumValueOptions::release_feature_support() {
::google::protobuf::internal::TSanWrite(&_impl_);
_impl_._has_bits_[0] &= ~0x00000002u;
::google::protobuf::FieldOptions_FeatureSupport* released = _impl_.feature_support_;
_impl_.feature_support_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released);
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
if (GetArena() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArena() != nullptr) {
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return released;
}
inline ::google::protobuf::FieldOptions_FeatureSupport* EnumValueOptions::unsafe_arena_release_feature_support() {
::google::protobuf::internal::TSanWrite(&_impl_);
// @@protoc_insertion_point(field_release:google.protobuf.EnumValueOptions.feature_support)
_impl_._has_bits_[0] &= ~0x00000002u;
::google::protobuf::FieldOptions_FeatureSupport* temp = _impl_.feature_support_;
_impl_.feature_support_ = nullptr;
return temp;
}
inline ::google::protobuf::FieldOptions_FeatureSupport* EnumValueOptions::_internal_mutable_feature_support() {
::google::protobuf::internal::TSanWrite(&_impl_);
if (_impl_.feature_support_ == nullptr) {
auto* p = ::google::protobuf::Message::DefaultConstruct<::google::protobuf::FieldOptions_FeatureSupport>(GetArena());
_impl_.feature_support_ = reinterpret_cast<::google::protobuf::FieldOptions_FeatureSupport*>(p);
}
return _impl_.feature_support_;
}
inline ::google::protobuf::FieldOptions_FeatureSupport* EnumValueOptions::mutable_feature_support() ABSL_ATTRIBUTE_LIFETIME_BOUND {
_impl_._has_bits_[0] |= 0x00000002u;
::google::protobuf::FieldOptions_FeatureSupport* _msg = _internal_mutable_feature_support();
// @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueOptions.feature_support)
return _msg;
}
inline void EnumValueOptions::set_allocated_feature_support(::google::protobuf::FieldOptions_FeatureSupport* value) {
::google::protobuf::Arena* message_arena = GetArena();
::google::protobuf::internal::TSanWrite(&_impl_);
if (message_arena == nullptr) {
delete (_impl_.feature_support_);
}
if (value != nullptr) {
::google::protobuf::Arena* submessage_arena = (value)->GetArena();
if (message_arena != submessage_arena) {
value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000002u;
} else {
_impl_._has_bits_[0] &= ~0x00000002u;
}
_impl_.feature_support_ = reinterpret_cast<::google::protobuf::FieldOptions_FeatureSupport*>(value);
// @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueOptions.feature_support)
}
// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
inline int EnumValueOptions::_internal_uninterpreted_option_size() const { inline int EnumValueOptions::_internal_uninterpreted_option_size() const {
return _internal_uninterpreted_option().size(); return _internal_uninterpreted_option().size();

@ -859,6 +859,9 @@ message EnumValueOptions {
// credentials. // credentials.
optional bool debug_redact = 3 [default = false]; optional bool debug_redact = 3 [default = false];
// Information about the support window of a feature value.
optional FieldOptions.FeatureSupport feature_support = 4;
// The parser stores options it doesn't recognize here. See above. // The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999; repeated UninterpretedOption uninterpreted_option = 999;

@ -293,6 +293,22 @@ void CollectLifetimeResults(Edition edition, const Message& message,
continue; continue;
} }
if (field->enum_type() != nullptr) {
int number = message.GetReflection()->GetEnumValue(message, field);
auto value = field->enum_type()->FindValueByNumber(number);
if (value != nullptr) {
const FieldOptions::FeatureSupport& support =
value->options().feature_support();
if (value->options().has_feature_support() &&
support.edition_introduced() > edition) {
results.errors.emplace_back(
absl::StrCat("Feature ", value->full_name(),
" wasn't introduced until edition ",
support.edition_introduced()));
}
}
}
// Skip fields that don't have feature support specified. // Skip fields that don't have feature support specified.
if (!field->options().has_feature_support()) continue; if (!field->options().has_feature_support()) continue;

@ -657,6 +657,29 @@ TEST(FeatureResolverLifetimesTest, DynamicPool) {
ElementsAre(HasSubstr("pb.TestFeatures.removed_feature"))); ElementsAre(HasSubstr("pb.TestFeatures.removed_feature")));
} }
TEST(FeatureResolverLifetimesTest, EmptyValueSupportInvalid2023) {
FeatureSet features = ParseTextOrDie(R"pb(
[pb.test] { file_feature: VALUE_EMPTY_SUPPORT }
)pb");
auto results = FeatureResolver::ValidateFeatureLifetimes(EDITION_2023,
features, nullptr);
EXPECT_THAT(results.errors, IsEmpty());
EXPECT_THAT(results.warnings, IsEmpty());
}
TEST(FeatureResolverLifetimesTest, ValueSupportInvalid2023) {
FeatureSet features = ParseTextOrDie(R"pb(
[pb.test] { file_feature: VALUE_FUTURE }
)pb");
auto results = FeatureResolver::ValidateFeatureLifetimes(EDITION_2023,
features, nullptr);
EXPECT_THAT(results.errors,
ElementsAre(AllOf(
HasSubstr("pb.VALUE_FUTURE"),
HasSubstr("introduced until edition 99997_TEST_ONLY"))));
EXPECT_THAT(results.warnings, IsEmpty());
}
class FakeErrorCollector : public io::ErrorCollector { class FakeErrorCollector : public io::ErrorCollector {
public: public:
FakeErrorCollector() = default; FakeErrorCollector() = default;

@ -43,6 +43,13 @@ enum EnumFeature {
VALUE13 = 13; VALUE13 = 13;
VALUE14 = 14; VALUE14 = 14;
VALUE15 = 15; VALUE15 = 15;
VALUE_EMPTY_SUPPORT = 98 [feature_support = {}];
VALUE_FUTURE = 99 [feature_support = {
edition_introduced: EDITION_99997_TEST_ONLY
edition_deprecated: EDITION_99998_TEST_ONLY
deprecation_warning: "Custom feature deprecation warning"
edition_removed: EDITION_99999_TEST_ONLY
}];
} }
message TestFeatures { message TestFeatures {

@ -273,12 +273,13 @@ const upb_MiniTable* google__protobuf__EnumOptions_msg_init() {
const upb_MiniTable* google__protobuf__EnumValueOptions_msg_init() { const upb_MiniTable* google__protobuf__EnumValueOptions_msg_init() {
static upb_MiniTable* mini_table = NULL; static upb_MiniTable* mini_table = NULL;
static const char* mini_descriptor = "$P/3/c~G"; static const char* mini_descriptor = "$P/3/3b~G";
if (mini_table) return mini_table; if (mini_table) return mini_table;
mini_table = mini_table =
upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor), upb_MiniTable_Build(mini_descriptor, strlen(mini_descriptor),
upb_BootstrapArena(), NULL); upb_BootstrapArena(), NULL);
upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 2), google__protobuf__FeatureSet_msg_init()); upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 2), google__protobuf__FeatureSet_msg_init());
upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 4), google__protobuf__FieldOptions__FeatureSupport_msg_init());
upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google__protobuf__UninterpretedOption_msg_init()); upb_MiniTable_SetSubMessage(mini_table, (upb_MiniTableField*)upb_MiniTable_FindFieldByNumber(mini_table, 999), google__protobuf__UninterpretedOption_msg_init());
return mini_table; return mini_table;
} }

@ -4961,6 +4961,22 @@ UPB_INLINE bool google_protobuf_EnumValueOptions_has_debug_redact(const google_p
const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 3); const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 3);
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
} }
UPB_INLINE void google_protobuf_EnumValueOptions_clear_feature_support(google_protobuf_EnumValueOptions* msg) {
const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 4);
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE const google_protobuf_FieldOptions_FeatureSupport* google_protobuf_EnumValueOptions_feature_support(const google_protobuf_EnumValueOptions* msg) {
const google_protobuf_FieldOptions_FeatureSupport* default_val = NULL;
const google_protobuf_FieldOptions_FeatureSupport* ret;
const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 4);
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE bool google_protobuf_EnumValueOptions_has_feature_support(const google_protobuf_EnumValueOptions* msg) {
const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 4);
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) { UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) {
const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999); const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999);
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
@ -5014,6 +5030,18 @@ UPB_INLINE void google_protobuf_EnumValueOptions_set_debug_redact(google_protobu
const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 3); const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 3);
upb_Message_SetBaseField((upb_Message *)msg, &field, &value); upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
} }
UPB_INLINE void google_protobuf_EnumValueOptions_set_feature_support(google_protobuf_EnumValueOptions *msg, google_protobuf_FieldOptions_FeatureSupport* value) {
const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 4);
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE struct google_protobuf_FieldOptions_FeatureSupport* google_protobuf_EnumValueOptions_mutable_feature_support(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
struct google_protobuf_FieldOptions_FeatureSupport* sub = (struct google_protobuf_FieldOptions_FeatureSupport*)google_protobuf_EnumValueOptions_feature_support(msg);
if (sub == NULL) {
sub = (struct google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(google__protobuf__FieldOptions__FeatureSupport_msg_init(), arena);
if (sub) google_protobuf_EnumValueOptions_set_feature_support(msg, sub);
}
return sub;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) {
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999); upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);

Loading…
Cancel
Save