Internal changes

PiperOrigin-RevId: 533624998
pull/12867/head
Mike Kruskal 2 years ago committed by Copybara-Service
parent afd4971110
commit bec4585d3d
  1. 17
      src/google/protobuf/compiler/command_line_interface.cc
  2. 1
      src/google/protobuf/compiler/command_line_interface_unittest.cc

@ -1306,13 +1306,16 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) {
// something like descriptor->file()->name(), but ExtensionRange does not // something like descriptor->file()->name(), but ExtensionRange does not
// support this. // support this.
for (const google::protobuf::FileDescriptor* file : parsed_files) { for (const google::protobuf::FileDescriptor* file : parsed_files) {
google::protobuf::internal::VisitDescriptors(*file, [&](const auto& descriptor) { FileDescriptorProto proto;
if (!ValidateTargetConstraints(descriptor.options(), *descriptor_pool, file->CopyTo(&proto);
*error_collector, file->name(), google::protobuf::internal::VisitDescriptors(
GetTargetType(&descriptor))) { *file, proto, [&](const auto& descriptor, const auto& proto) {
validation_error = true; if (!ValidateTargetConstraints(proto.options(), *descriptor_pool,
} *error_collector, file->name(),
}); GetTargetType(&descriptor))) {
validation_error = true;
}
});
} }

@ -1419,6 +1419,7 @@ TEST_F(CommandLineInterfaceTest, AllowServicesHasService) {
} }
TEST_F(CommandLineInterfaceTest, DirectDependencies_Missing_EmptyList) { TEST_F(CommandLineInterfaceTest, DirectDependencies_Missing_EmptyList) {
CreateTempFile("foo.proto", CreateTempFile("foo.proto",
"syntax = \"proto2\";\n" "syntax = \"proto2\";\n"

Loading…
Cancel
Save