Add `ABSL_ATTRIBUTE_LIFETIME_BOUND` attribute on generated extension accessors.

This allows the compiler to statically detect use-after-free bugs.

This change touches a subset of field types. More changes to follow.

PiperOrigin-RevId: 568586855
pull/14221/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 1e0bc565a0
commit 7a2c6b5652
  1. 42
      src/google/protobuf/compiler/cpp/message.cc
  2. 400
      src/google/protobuf/descriptor.pb.h
  3. 8
      src/google/protobuf/extension_set.h

@ -767,7 +767,8 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* p) {
}
template <typename _proto_TypeTraits, $pbi$::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
@ -775,11 +776,23 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* p) {
return _proto_TypeTraits::Get(id.number(), $extensions$, id.default_value());
}
template <typename _proto_TypeTraits, $pbi$::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
$annotate_extension_get$;
return _proto_TypeTraits::Get(id.number(), $extensions$, id.default_value());
}
template <typename _proto_TypeTraits, $pbi$::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
$annotate_extension_mutable$;
return _proto_TypeTraits::Mutable(id.number(), _field_type, &$extensions$);
}
@ -836,7 +849,8 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* p) {
}
template <typename _proto_TypeTraits, $pbi$::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -845,12 +859,23 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* p) {
return _proto_TypeTraits::Get(id.number(), $extensions$, index);
}
template <typename _proto_TypeTraits, $pbi$::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
$annotate_repeated_extension_get$;
return _proto_TypeTraits::Get(id.number(), $extensions$, index);
}
template <typename _proto_TypeTraits, $pbi$::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
$annotate_repeated_extension_mutable$;
return _proto_TypeTraits::Mutable(id.number(), index, &$extensions$);
}
@ -869,7 +894,8 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* p) {
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &$extensions$);
$annotate_repeated_extension_add_mutable$;
@ -892,7 +918,8 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* p) {
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
$annotate_repeated_extension_list$;
return _proto_TypeTraits::GetRepeated(id.number(), $extensions$);
}
@ -902,7 +929,8 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* p) {
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const $pbi$::ExtensionIdentifier<$Msg$, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
$annotate_repeated_extension_list_mutable$;
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &$extensions$);

@ -1924,18 +1924,30 @@ class PROTOBUF_EXPORT FeatureSet final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -1986,7 +1998,8 @@ class PROTOBUF_EXPORT FeatureSet final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -1994,12 +2007,22 @@ class PROTOBUF_EXPORT FeatureSet final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -2016,7 +2039,8 @@ class PROTOBUF_EXPORT FeatureSet final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -2037,7 +2061,8 @@ class PROTOBUF_EXPORT FeatureSet final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -2046,7 +2071,8 @@ class PROTOBUF_EXPORT FeatureSet final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FeatureSet, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -3760,18 +3786,30 @@ class PROTOBUF_EXPORT ServiceOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -3822,7 +3860,8 @@ class PROTOBUF_EXPORT ServiceOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -3830,12 +3869,22 @@ class PROTOBUF_EXPORT ServiceOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -3852,7 +3901,8 @@ class PROTOBUF_EXPORT ServiceOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -3873,7 +3923,8 @@ class PROTOBUF_EXPORT ServiceOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -3882,7 +3933,8 @@ class PROTOBUF_EXPORT ServiceOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ServiceOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -4115,18 +4167,30 @@ class PROTOBUF_EXPORT OneofOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -4177,7 +4241,8 @@ class PROTOBUF_EXPORT OneofOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -4185,12 +4250,22 @@ class PROTOBUF_EXPORT OneofOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -4207,7 +4282,8 @@ class PROTOBUF_EXPORT OneofOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -4228,7 +4304,8 @@ class PROTOBUF_EXPORT OneofOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -4237,7 +4314,8 @@ class PROTOBUF_EXPORT OneofOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<OneofOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -4514,18 +4592,30 @@ class PROTOBUF_EXPORT MethodOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -4576,7 +4666,8 @@ class PROTOBUF_EXPORT MethodOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -4584,12 +4675,22 @@ class PROTOBUF_EXPORT MethodOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -4606,7 +4707,8 @@ class PROTOBUF_EXPORT MethodOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -4627,7 +4729,8 @@ class PROTOBUF_EXPORT MethodOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -4636,7 +4739,8 @@ class PROTOBUF_EXPORT MethodOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MethodOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -4930,18 +5034,30 @@ class PROTOBUF_EXPORT MessageOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -4992,7 +5108,8 @@ class PROTOBUF_EXPORT MessageOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -5000,12 +5117,22 @@ class PROTOBUF_EXPORT MessageOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -5022,7 +5149,8 @@ class PROTOBUF_EXPORT MessageOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -5043,7 +5171,8 @@ class PROTOBUF_EXPORT MessageOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -5052,7 +5181,8 @@ class PROTOBUF_EXPORT MessageOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<MessageOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -5610,18 +5740,30 @@ class PROTOBUF_EXPORT FileOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -5672,7 +5814,8 @@ class PROTOBUF_EXPORT FileOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -5680,12 +5823,22 @@ class PROTOBUF_EXPORT FileOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -5702,7 +5855,8 @@ class PROTOBUF_EXPORT FileOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -5723,7 +5877,8 @@ class PROTOBUF_EXPORT FileOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -5732,7 +5887,8 @@ class PROTOBUF_EXPORT FileOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FileOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -6224,18 +6380,30 @@ class PROTOBUF_EXPORT FieldOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -6286,7 +6454,8 @@ class PROTOBUF_EXPORT FieldOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -6294,12 +6463,22 @@ class PROTOBUF_EXPORT FieldOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -6316,7 +6495,8 @@ class PROTOBUF_EXPORT FieldOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -6337,7 +6517,8 @@ class PROTOBUF_EXPORT FieldOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -6346,7 +6527,8 @@ class PROTOBUF_EXPORT FieldOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<FieldOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -6854,18 +7036,30 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -6916,7 +7110,8 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -6924,12 +7119,22 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -6946,7 +7151,8 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -6967,7 +7173,8 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -6976,7 +7183,8 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<ExtensionRangeOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -7234,18 +7442,30 @@ class PROTOBUF_EXPORT EnumValueOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -7296,7 +7516,8 @@ class PROTOBUF_EXPORT EnumValueOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -7304,12 +7525,22 @@ class PROTOBUF_EXPORT EnumValueOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -7326,7 +7557,8 @@ class PROTOBUF_EXPORT EnumValueOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -7347,7 +7579,8 @@ class PROTOBUF_EXPORT EnumValueOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -7356,7 +7589,8 @@ class PROTOBUF_EXPORT EnumValueOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumValueOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}
@ -7626,18 +7860,30 @@ class PROTOBUF_EXPORT EnumOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value());
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_);
}
@ -7688,7 +7934,8 @@ class PROTOBUF_EXPORT EnumOptions final :
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
bool _is_packed,
std::enable_if_t<!_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
@ -7696,12 +7943,22 @@ class PROTOBUF_EXPORT EnumOptions final :
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed,
std::enable_if_t<_proto_TypeTraits::kLifetimeBound, int> = 0>
inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) const ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
}
template <typename _proto_TypeTraits, ::google::protobuf::internal::FieldType _field_type,
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id,
int index) {
int index) ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
}
@ -7718,7 +7975,8 @@ class PROTOBUF_EXPORT EnumOptions final :
bool _is_packed>
inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
typename _proto_TypeTraits::Repeated::MutableType to_add =
_proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
return to_add;
@ -7739,7 +7997,8 @@ class PROTOBUF_EXPORT EnumOptions final :
inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
GetRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) const {
_field_type, _is_packed>& id) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
}
@ -7748,7 +8007,8 @@ class PROTOBUF_EXPORT EnumOptions final :
inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
MutableRepeatedExtension(
const ::google::protobuf::internal::ExtensionIdentifier<EnumOptions, _proto_TypeTraits,
_field_type, _is_packed>& id) {
_field_type, _is_packed>& id)
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
_is_packed, &_impl_._extensions_);
}

@ -999,6 +999,7 @@ class PrimitiveTypeTraits {
typedef Type ConstType;
typedef Type MutableType;
typedef PrimitiveTypeTraits<Type> Singular;
static constexpr bool kLifetimeBound = false;
static inline ConstType Get(int number, const ExtensionSet& set,
ConstType default_value);
@ -1021,6 +1022,7 @@ class RepeatedPrimitiveTypeTraits {
typedef Type ConstType;
typedef Type MutableType;
typedef RepeatedPrimitiveTypeTraits<Type> Repeated;
static constexpr bool kLifetimeBound = false;
typedef RepeatedField<Type> RepeatedFieldType;
@ -1147,6 +1149,7 @@ class PROTOBUF_EXPORT StringTypeTraits {
typedef const std::string& ConstType;
typedef std::string* MutableType;
typedef StringTypeTraits Singular;
static constexpr bool kLifetimeBound = true;
static inline const std::string& Get(int number, const ExtensionSet& set,
ConstType default_value) {
@ -1177,6 +1180,7 @@ class PROTOBUF_EXPORT RepeatedStringTypeTraits {
typedef const std::string& ConstType;
typedef std::string* MutableType;
typedef RepeatedStringTypeTraits Repeated;
static constexpr bool kLifetimeBound = true;
typedef RepeatedPtrField<std::string> RepeatedFieldType;
@ -1244,6 +1248,7 @@ class EnumTypeTraits {
typedef Type ConstType;
typedef Type MutableType;
typedef EnumTypeTraits<Type, IsValid> Singular;
static constexpr bool kLifetimeBound = false;
static inline ConstType Get(int number, const ExtensionSet& set,
ConstType default_value) {
@ -1275,6 +1280,7 @@ class RepeatedEnumTypeTraits {
typedef Type ConstType;
typedef Type MutableType;
typedef RepeatedEnumTypeTraits<Type, IsValid> Repeated;
static constexpr bool kLifetimeBound = false;
typedef RepeatedField<Type> RepeatedFieldType;
@ -1349,6 +1355,7 @@ class MessageTypeTraits {
typedef const Type& ConstType;
typedef Type* MutableType;
typedef MessageTypeTraits<Type> Singular;
static constexpr bool kLifetimeBound = true;
static inline ConstType Get(int number, const ExtensionSet& set,
ConstType default_value) {
@ -1407,6 +1414,7 @@ class RepeatedMessageTypeTraits {
typedef const Type& ConstType;
typedef Type* MutableType;
typedef RepeatedMessageTypeTraits<Type> Repeated;
static constexpr bool kLifetimeBound = true;
typedef RepeatedPtrField<Type> RepeatedFieldType;

Loading…
Cancel
Save