diff --git a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc index 57e6d7e6c..1c1a413dc 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc @@ -496,7 +496,7 @@ void RepeatedEnumFieldGenerator::GenerateConstinitInitializer( format("$name$_()"); if (descriptor_->is_packed() && HasGeneratedMethods(descriptor_->file(), options_)) { - format("\n, _$name$_cached_byte_size_()"); + format("\n, _$name$_cached_byte_size_(0)"); } } diff --git a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc index 9f7f61e16..40e06403a 100644 --- a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc @@ -486,7 +486,7 @@ void RepeatedPrimitiveFieldGenerator::GenerateConstinitInitializer( format("$name$_()"); if (descriptor_->is_packed() && FixedSize(descriptor_->type()) == -1 && HasGeneratedMethods(descriptor_->file(), options_)) { - format("\n, _$name$_cached_byte_size_()"); + format("\n, _$name$_cached_byte_size_(0)"); } } diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 9fb0dfac8..bb91024d2 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -393,9 +393,9 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT UninterpretedOptionDefaultTypeI constexpr SourceCodeInfo_Location::SourceCodeInfo_Location( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : path_() - , _path_cached_byte_size_() + , _path_cached_byte_size_(0) , span_() - , _span_cached_byte_size_() + , _span_cached_byte_size_(0) , leading_detached_comments_() , leading_comments_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , trailing_comments_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} @@ -423,7 +423,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SourceCodeInfoDefaultTypeIntern constexpr GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) : path_() - , _path_cached_byte_size_() + , _path_cached_byte_size_(0) , source_file_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) , begin_(0) , end_(0){}