Skip to content

Commit

Permalink
Automated rollback of commit 100d54b.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 706019093
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Dec 13, 2024
1 parent 0176416 commit d9a542b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
11 changes: 3 additions & 8 deletions src/google/protobuf/compiler/cpp/extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ ExtensionGenerator::ExtensionGenerator(const FieldDescriptor* descriptor,
variables_["constant_name"] = FieldConstantName(descriptor_);
variables_["field_type"] =
absl::StrCat(static_cast<int>(descriptor_->type()));
// Downgrade string to bytes if it is not UTF8 validated.
if (descriptor_->type() == FieldDescriptor::TYPE_STRING &&
!descriptor_->requires_utf8_validation()) {
variables_["field_type"] =
absl::StrCat(static_cast<int>(FieldDescriptor::TYPE_BYTES));
}
variables_["repeated"] = descriptor_->is_repeated() ? "true" : "false";
variables_["packed"] = descriptor_->is_packed() ? "true" : "false";
variables_["dllexport_decl"] = options.dllexport_decl;
Expand Down Expand Up @@ -275,8 +269,9 @@ void ExtensionGenerator::GenerateRegistration(io::Printer* p,
(::_pbi::ExtensionSet::ShouldRegisterAtThisTime(
{{&$extendee_table$, $extendee_index$}}, $preregister$)
? ::_pbi::ExtensionSet::RegisterExtension(
::_pbi::GetPrototypeForWeakDescriptor(
&$extendee_table$, $extendee_index$, true),
::_pbi::GetPrototypeForWeakDescriptor(&$extendee_table$,
$extendee_index$,
true),
$number$, $field_type$, $repeated$, $packed$)
: (void)0),
)cc");
Expand Down
7 changes: 0 additions & 7 deletions src/google/protobuf/unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,6 @@ extend TestAllExtensions {
TestAllTypes.NestedMessage oneof_nested_message_extension = 112;
string oneof_string_extension = 113;
bytes oneof_bytes_extension = 114;

string optional_utf8_string_extension = 115 [
features.utf8_validation = VERIFY
];
repeated string repeated_utf8_string_extension = 116 [
features.utf8_validation = VERIFY
];
}

message OptionalGroup_extension {
Expand Down

0 comments on commit d9a542b

Please sign in to comment.