diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index f3bd0844e5..0d271d4dcb 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -1264,7 +1264,8 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) { // Enforce extension declarations only when compiling. We want to skip // this enforcement when protoc is just being invoked to encode or decode // protos. - if (mode_ == MODE_COMPILE) { + if (mode_ == MODE_COMPILE + ) { descriptor_pool->EnforceExtensionDeclarations(true); } if (!ParseInputFiles(descriptor_pool.get(), disk_source_tree.get(),