Browse Source

Fix internal build breakage

PiperOrigin-RevId: 519277200
pull/12338/head
Protobuf Team Bot 1 year ago
committed by Copybara-Service
parent
commit
3a871acca0
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      src/google/protobuf/descriptor.h

+ 6
- 5
src/google/protobuf/descriptor.h View File

@ -2647,17 +2647,18 @@ PROTOBUF_EXPORT bool HasHasbit(const FieldDescriptor* field);
// For a string field, returns the effective ctype. If the actual ctype is
// not supported, returns the default of STRING.
template <typename FD = FieldDescriptor, typename FO = FieldOptions>
typename FO::CType EffectiveStringCType(const FD* field) {
template <typename FieldDesc = FieldDescriptor,
typename FieldOpts = FieldOptions>
typename FieldOpts::CType EffectiveStringCType(const FieldDesc* field) {
ABSL_DCHECK(field->cpp_type() == FieldDescriptor::CPPTYPE_STRING);
ABSL_DCHECK(!field->is_extension());
// Open-source protobuf release only supports STRING ctype and CORD for
// sinuglar bytes.
if (field->type() == FieldDescriptor::TYPE_BYTES && !field->is_repeated() &&
field->options().ctype() == FO::CORD) {
return FO::CORD;
field->options().ctype() == FieldOpts::CORD) {
return FieldOpts::CORD;
}
return FO::STRING;
return FieldOpts::STRING;
}
#ifndef SWIG


Loading…
Cancel
Save