Skip to content

Commit

Permalink
Fix compiler error for empty default ctor for std::atomic<int> variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dschopf committed May 21, 2021
1 parent 12a9fec commit bbccb31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/cpp/cpp_enum_field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/google/protobuf/descriptor.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bbccb31

Please sign in to comment.