Merge tag 'refs/tags/sync-piper' into sync-stage

pull/10196/head
theodorerose 2 years ago
commit 58174f2f76
  1. 1
      Makefile.am
  2. 2
      Protobuf-C++.podspec
  3. 28
      cmake/install.cmake
  4. 2
      configure.ac
  5. 3
      csharp/src/Google.Protobuf/Google.Protobuf.csproj
  6. 18
      docs/jvm_aot.md
  7. 1040
      java/core/src/main/java/com/google/protobuf/GeneratedMessage.java
  8. 2
      java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java
  9. 3
      java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java
  10. 2
      python/google/protobuf/__init__.py
  11. 9
      python/google/protobuf/descriptor.py
  12. 8
      python/google/protobuf/internal/descriptor_test.py
  13. 2
      src/Makefile.am
  14. 2
      src/google/protobuf/any.pb.h
  15. 2
      src/google/protobuf/api.pb.h
  16. 3
      src/google/protobuf/arena.cc
  17. 1
      src/google/protobuf/arena_impl.h
  18. 1
      src/google/protobuf/compiler/cpp/field.cc
  19. 1
      src/google/protobuf/compiler/cpp/field.h
  20. 21
      src/google/protobuf/compiler/cpp/helpers.cc
  21. 8
      src/google/protobuf/compiler/cpp/message.cc
  22. 2
      src/google/protobuf/compiler/plugin.pb.h
  23. 2
      src/google/protobuf/descriptor.pb.h
  24. 2
      src/google/protobuf/duration.pb.h
  25. 2
      src/google/protobuf/empty.pb.h
  26. 2
      src/google/protobuf/field_mask.pb.h
  27. 6
      src/google/protobuf/port_def.inc
  28. 2
      src/google/protobuf/source_context.pb.h
  29. 2
      src/google/protobuf/struct.pb.h
  30. 2
      src/google/protobuf/stubs/common.h
  31. 6
      src/google/protobuf/test_messages_proto2.proto
  32. 2
      src/google/protobuf/timestamp.pb.h
  33. 2
      src/google/protobuf/type.pb.h
  34. 2
      src/google/protobuf/wrappers.pb.h

@ -92,6 +92,7 @@ csharp_EXTRA_DIST= \
csharp/src/AddressBook/ListPeople.cs \ csharp/src/AddressBook/ListPeople.cs \
csharp/src/AddressBook/Program.cs \ csharp/src/AddressBook/Program.cs \
csharp/src/AddressBook/SampleUsage.cs \ csharp/src/AddressBook/SampleUsage.cs \
csharp/src/Directory.Build.props \
csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs \ csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs \
csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \ csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \
csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \ csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Protobuf-C++' s.name = 'Protobuf-C++'
s.version = '3.21.1' s.version = '3.21.2'
s.summary = 'Protocol Buffers v3 runtime library for C++.' s.summary = 'Protocol Buffers v3 runtime library for C++.'
s.homepage = 'https://github.com/google/protobuf' s.homepage = 'https://github.com/google/protobuf'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'

@ -102,47 +102,55 @@ foreach(_file ${nobase_dist_proto_DATA})
endforeach() endforeach()
# Install configuration # Install configuration
set(_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files") set(_install_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files")
set(_build_cmakedir_desc "Directory relative to CMAKE_CURRENT_BINARY_DIR for cmake configuration files")
set(_exampledir_desc "Directory relative to CMAKE_INSTALL_DATA to install examples") set(_exampledir_desc "Directory relative to CMAKE_INSTALL_DATA to install examples")
set(_protobuf_subdir_desc "Subdirectory in which to install cmake configuration files")
if(NOT MSVC) if(NOT MSVC)
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/protobuf" CACHE STRING "${_cmakedir_desc}") set(protobuf_CMAKE_SUBDIR "cmake/protobuf" CACHE STRING "${_protobuf_subdir_desc}")
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/${protobuf_CMAKE_SUBDIR}" CACHE STRING "${_install_cmakedir_desc}")
set(CMAKE_INSTALL_EXAMPLEDIR "${CMAKE_INSTALL_DATADIR}/protobuf/examples" CACHE STRING "${_exampledir_desc}") set(CMAKE_INSTALL_EXAMPLEDIR "${CMAKE_INSTALL_DATADIR}/protobuf/examples" CACHE STRING "${_exampledir_desc}")
else() else()
set(protobuf_CMAKE_SUBDIR "cmake" CACHE STRING "${_protobuf_subdir_desc}")
set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}") set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}")
set(CMAKE_INSTALL_EXAMPLEDIR "examples" CACHE STRING "${_exampledir_desc}") set(CMAKE_INSTALL_EXAMPLEDIR "examples" CACHE STRING "${_exampledir_desc}")
endif() endif()
set(CMAKE_BUILD_CMAKEDIR "${CMAKE_CURRENT_BINARY_DIR}/${protobuf_CMAKE_SUBDIR}" CACHE STRING "${_build_cmakedir_desc}")
mark_as_advanced(protobuf_CMAKE_SUBDIR)
mark_as_advanced(CMAKE_BUILD_CMAKEDIR)
mark_as_advanced(CMAKE_INSTALL_CMAKEDIR) mark_as_advanced(CMAKE_INSTALL_CMAKEDIR)
mark_as_advanced(CMAKE_INSTALL_EXAMPLEDIR) mark_as_advanced(CMAKE_INSTALL_EXAMPLEDIR)
configure_file(${protobuf_SOURCE_DIR}/cmake/protobuf-config.cmake.in configure_file(${protobuf_SOURCE_DIR}/cmake/protobuf-config.cmake.in
${CMAKE_INSTALL_CMAKEDIR}/protobuf-config.cmake @ONLY) ${CMAKE_BUILD_CMAKEDIR}/protobuf-config.cmake @ONLY)
configure_file(${protobuf_SOURCE_DIR}/cmake/protobuf-config-version.cmake.in configure_file(${protobuf_SOURCE_DIR}/cmake/protobuf-config-version.cmake.in
${CMAKE_INSTALL_CMAKEDIR}/protobuf-config-version.cmake @ONLY) ${CMAKE_BUILD_CMAKEDIR}/protobuf-config-version.cmake @ONLY)
configure_file(${protobuf_SOURCE_DIR}/cmake/protobuf-module.cmake.in configure_file(${protobuf_SOURCE_DIR}/cmake/protobuf-module.cmake.in
${CMAKE_INSTALL_CMAKEDIR}/protobuf-module.cmake @ONLY) ${CMAKE_BUILD_CMAKEDIR}/protobuf-module.cmake @ONLY)
configure_file(${protobuf_SOURCE_DIR}/cmake/protobuf-options.cmake configure_file(${protobuf_SOURCE_DIR}/cmake/protobuf-options.cmake
${CMAKE_INSTALL_CMAKEDIR}/protobuf-options.cmake @ONLY) ${CMAKE_BUILD_CMAKEDIR}/protobuf-options.cmake @ONLY)
# Allows the build directory to be used as a find directory. # Allows the build directory to be used as a find directory.
if (protobuf_BUILD_PROTOC_BINARIES) if (protobuf_BUILD_PROTOC_BINARIES)
export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc
NAMESPACE protobuf:: NAMESPACE protobuf::
FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake FILE ${CMAKE_BUILD_CMAKEDIR}/protobuf-targets.cmake
) )
else (protobuf_BUILD_PROTOC_BINARIES) else (protobuf_BUILD_PROTOC_BINARIES)
export(TARGETS libprotobuf-lite libprotobuf export(TARGETS libprotobuf-lite libprotobuf
NAMESPACE protobuf:: NAMESPACE protobuf::
FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake FILE ${CMAKE_BUILD_CMAKEDIR}/protobuf-targets.cmake
) )
endif (protobuf_BUILD_PROTOC_BINARIES) endif (protobuf_BUILD_PROTOC_BINARIES)
install(EXPORT protobuf-targets install(EXPORT protobuf-targets
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
NAMESPACE protobuf:: NAMESPACE protobuf::
COMPONENT protobuf-export) COMPONENT protobuf-export
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/ install(DIRECTORY ${CMAKE_BUILD_CMAKEDIR}/
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
COMPONENT protobuf-export COMPONENT protobuf-export
PATTERN protobuf-targets.cmake EXCLUDE PATTERN protobuf-targets.cmake EXCLUDE

@ -17,7 +17,7 @@ AC_PREREQ(2.59)
# In the SVN trunk, the version should always be the next anticipated release # In the SVN trunk, the version should always be the next anticipated release
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
# the size of one file name in the dist tarfile over the 99-char limit.) # the size of one file name in the dist tarfile over the 99-char limit.)
AC_INIT([Protocol Buffers],[3.21.1],[protobuf@googlegroups.com],[protobuf]) AC_INIT([Protocol Buffers],[3.21.2],[protobuf@googlegroups.com],[protobuf])
AM_MAINTAINER_MODE([enable]) AM_MAINTAINER_MODE([enable])

@ -5,8 +5,7 @@
<Copyright>Copyright 2015, Google Inc.</Copyright> <Copyright>Copyright 2015, Google Inc.</Copyright>
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle> <AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
<VersionPrefix>3.21.2</VersionPrefix> <VersionPrefix>3.21.2</VersionPrefix>
<!-- C# 7.2 is required for Span/BufferWriter/ReadOnlySequence --> <LangVersion>10.0</LangVersion>
<LangVersion>7.2</LangVersion>
<Authors>Google Inc.</Authors> <Authors>Google Inc.</Authors>
<TargetFrameworks>netstandard1.1;netstandard2.0;net45;net50</TargetFrameworks> <TargetFrameworks>netstandard1.1;netstandard2.0;net45;net50</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>

@ -1,8 +1,8 @@
# Ahead Of Time (AOT) compilation for the Java Virtual Machine (JVM)" # Ahead Of Time (AOT) compilation for the Java Virtual Machine (JVM)
Ahead Of Time (AOT) compilation build tools such as those provided by [GraalVM's `native-image`](https://www.graalvm.org/reference-manual/native-image/) can require some configuration when using protobuf. Ahead Of Time (AOT) compilation build tools such as those provided by [GraalVM's `native-image`](https://www.graalvm.org/reference-manual/native-image/) can require some configuration when using protobuf.
Protobuf for the JVM uses reflection and some of its target classes are not possible to determine in advance. Protobuf for the JVM uses reflection, and some of its target classes are not possible to determine in advance.
Historically, there were good reasons to use reflection based on APIs that were published effectively requiring them, and this situation is unlikely to change. This situation is unlikely to change.
[The Lite version of protobuf for the JVM](https://github.com/protocolbuffers/protobuf/blob/main/java/lite.md) [The Lite version of protobuf for the JVM](https://github.com/protocolbuffers/protobuf/blob/main/java/lite.md)
avoids reflection and may be better suited for use with AOT compilation tooling. This Lite version was originally targeted for use on Android which has similar AOT compilation avoids reflection and may be better suited for use with AOT compilation tooling. This Lite version was originally targeted for use on Android which has similar AOT compilation
@ -10,9 +10,11 @@ goals as GraalVM's native-image tool.
## GraalVM native-image ## GraalVM native-image
This section addresses GraalVM's `native-image` configuration specifically as this AOT compilation tool due to its popularity. The `native-image` tool can be configured The GraalVM `native-image` tool can be configured with options for the
with respect to: the [Java Native Interface](https://en.wikipedia.org/wiki/Java_Native_Interface) (JNI), http proxying, reflection, and other resources. While these [Java Native Interface](https://www.graalvm.org/22.0/reference-manual/native-image/JNI/) (JNI),
considerations can be manually declared as JSON files, we recommend that a JVM application is exercised along with http proxying, reflection, and other resources. While these
configuration options can be manually specified in JSON files, we recommend
that you exercise the application with
[the assisted configuration agent](https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/#assisted-configuration-of-native-image-builds). The agent [the assisted configuration agent](https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/#assisted-configuration-of-native-image-builds). The agent
will generate files that you can then subsequently point at when invoking `native-image`. We recommend that the generated files are retained with a project's source will generate native-image.properties files that you add to the project's
code. META-INF/native-image/ directory. The Native Image builder uses configuration options provided in META-INF/native-image/ to construct native-image command line arguments.

@ -43,7 +43,7 @@ import java.nio.ByteBuffer;
* ByteString} can lead to unexpected and undesirable consequences in your application, and will * ByteString} can lead to unexpected and undesirable consequences in your application, and will
* likely be difficult to debug. Proceed with caution! * likely be difficult to debug. Proceed with caution!
* *
* <p>This can have a number of significant side affects that have spooky-action-at-a-distance-like * <p>This can have a number of significant side effects that have spooky-action-at-a-distance-like
* behavior. In particular, if the bytes value changes out from under a Protocol Buffer: * behavior. In particular, if the bytes value changes out from under a Protocol Buffer:
* *
* <ul> * <ul>

@ -101,9 +101,8 @@ public final class FieldMaskUtil {
/** /**
* Constructs a FieldMask for a list of field paths in a certain type. * Constructs a FieldMask for a list of field paths in a certain type.
* *
* @throws IllegalArgumentException if any of the field path is not valid. * @throws IllegalArgumentException if any of the field path is not valid
*/ */
// TODO(xiaofeng): Consider renaming fromStrings()
public static FieldMask fromStringList(Class<? extends Message> type, Iterable<String> paths) { public static FieldMask fromStringList(Class<? extends Message> type, Iterable<String> paths) {
return fromStringList(Internal.getDefaultInstance(type).getDescriptorForType(), paths); return fromStringList(Internal.getDefaultInstance(type).getDescriptorForType(), paths);
} }

@ -30,4 +30,4 @@
# Copyright 2007 Google Inc. All Rights Reserved. # Copyright 2007 Google Inc. All Rights Reserved.
__version__ = '4.21.1' __version__ = '4.21.2'

@ -873,11 +873,14 @@ class ServiceDescriptor(_NestedDescriptorBase):
Args: Args:
name (str): Name of the method. name (str): Name of the method.
Returns: Returns:
MethodDescriptor or None: the descriptor for the requested method, if MethodDescriptor: The descriptor for the requested method.
found.
Raises:
KeyError: if the method cannot be found in the service.
""" """
return self.methods_by_name.get(name, None) return self.methods_by_name[name]
def CopyToProto(self, proto): def CopyToProto(self, proto):
"""Copies this to a descriptor_pb2.ServiceDescriptorProto. """Copies this to a descriptor_pb2.ServiceDescriptorProto.

@ -118,6 +118,14 @@ class DescriptorTest(unittest.TestCase):
def GetDescriptorPool(self): def GetDescriptorPool(self):
return symbol_database.Default().pool return symbol_database.Default().pool
def testFindMethodByName(self):
service_descriptor = (unittest_custom_options_pb2.
TestServiceWithCustomOptions.DESCRIPTOR)
method_descriptor = service_descriptor.FindMethodByName('Foo')
self.assertEqual(method_descriptor.name, 'Foo')
with self.assertRaises(KeyError):
service_descriptor.FindMethodByName('MethodDoesNotExist')
def testEnumValueName(self): def testEnumValueName(self):
self.assertEqual(self.my_message.EnumValueName('ForeignEnum', 4), self.assertEqual(self.my_message.EnumValueName('ForeignEnum', 4),
'FOREIGN_FOO') 'FOREIGN_FOO')

@ -18,7 +18,7 @@ else
PTHREAD_DEF = PTHREAD_DEF =
endif endif
PROTOBUF_VERSION = 32:1:0 PROTOBUF_VERSION = 32:2:0
if GCC if GCC
# Turn on all warnings except for sign comparison (we ignore sign comparison # Turn on all warnings except for sign comparison (we ignore sign comparison

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -153,7 +153,8 @@ void* SerialArena::AllocateAlignedWithCleanupFallback(
PROTOBUF_NOINLINE PROTOBUF_NOINLINE
void SerialArena::AddCleanupFallback(void* elem, void (*destructor)(void*), void SerialArena::AddCleanupFallback(void* elem, void (*destructor)(void*),
const AllocationPolicy* policy) { const AllocationPolicy* policy) {
AllocateNewBlock(0, policy); size_t required = cleanup::Size(destructor);
AllocateNewBlock(required, policy);
AddCleanupFromExisting(elem, destructor); AddCleanupFromExisting(elem, destructor);
} }

@ -136,6 +136,7 @@ inline PROTOBUF_ALWAYS_INLINE void CreateNode(Tag tag, void* pos,
} }
inline PROTOBUF_ALWAYS_INLINE void PrefetchNode(const void* elem_address) { inline PROTOBUF_ALWAYS_INLINE void PrefetchNode(const void* elem_address) {
(void)elem_address;
} }
inline PROTOBUF_ALWAYS_INLINE void DestroyNode(Tag tag, const void* pos) { inline PROTOBUF_ALWAYS_INLINE void DestroyNode(Tag tag, const void* pos) {

@ -330,6 +330,7 @@ void FieldGenerator::GenerateCopyConstructorCode(io::Printer* printer) const {
} }
} }
void SetCommonOneofFieldVariables( void SetCommonOneofFieldVariables(
const FieldDescriptor* descriptor, const FieldDescriptor* descriptor,
std::map<std::string, std::string>* variables) { std::map<std::string, std::string>* variables) {

@ -208,6 +208,7 @@ class FieldGenerator {
virtual bool IsInlined() const { return false; } virtual bool IsInlined() const { return false; }
virtual ArenaDtorNeeds NeedsArenaDestructor() const { virtual ArenaDtorNeeds NeedsArenaDestructor() const {
return ArenaDtorNeeds::kNone; return ArenaDtorNeeds::kNone;
} }

@ -76,7 +76,8 @@ std::string DotsToColons(const std::string& name) {
return StringReplace(name, ".", "::", true); return StringReplace(name, ".", "::", true);
} }
static const char* const kKeywordList[] = { // static const char* const kKeywordList[] = {
//
"NULL", "NULL",
"alignas", "alignas",
"alignof", "alignof",
@ -159,7 +160,21 @@ static const char* const kKeywordList[] = { //
"wchar_t", "wchar_t",
"while", "while",
"xor", "xor",
"xor_eq"}; "xor_eq",
#ifdef PROTOBUF_FUTURE_CPP20_KEYWORDS // C++20 keywords.
"char8_t",
"char16_t",
"char32_t",
"concept",
"consteval",
"constinit",
"co_await",
"co_return",
"co_yield",
"requires",
#endif // !PROTOBUF_FUTURE_BREAKING_CHANGES
};
static std::unordered_set<std::string>* MakeKeywordsMap() { static std::unordered_set<std::string>* MakeKeywordsMap() {
auto* result = new std::unordered_set<std::string>(); auto* result = new std::unordered_set<std::string>();
@ -509,6 +524,7 @@ std::string FieldName(const FieldDescriptor* field) {
return result; return result;
} }
std::string FieldMemberName(const FieldDescriptor* field, bool split) { std::string FieldMemberName(const FieldDescriptor* field, bool split) {
StringPiece prefix = StringPiece prefix =
IsMapEntryMessage(field->containing_type()) ? "" : "_impl_."; IsMapEntryMessage(field->containing_type()) ? "" : "_impl_.";
@ -856,6 +872,7 @@ std::string SafeFunctionName(const Descriptor* descriptor,
return function_name; return function_name;
} }
bool IsStringInlined(const FieldDescriptor* descriptor, bool IsStringInlined(const FieldDescriptor* descriptor,
const Options& options) { const Options& options) {
(void)descriptor; (void)descriptor;

@ -790,10 +790,12 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* printer) {
std::map<std::string, std::string> vars; std::map<std::string, std::string> vars;
SetCommonFieldVariables(field, &vars, options_); SetCommonFieldVariables(field, &vars, options_);
format.AddMap(vars); format.AddMap(vars);
if (field->is_repeated()) { if (field->is_repeated()) {
format("$deprecated_attr$int ${1$$name$_size$}$() const$2$\n", field, format(
"$deprecated_attr$int ${1$$name$_size$}$() const$2$\n", field,
!IsFieldStripped(field, options_) ? ";" : " {__builtin_trap();}"); !IsFieldStripped(field, options_) ? ";" : " {__builtin_trap();}");
if (!IsFieldStripped(field, options_)) { if (!IsFieldStripped(field, options_)) {
format( format(
@ -803,7 +805,8 @@ void MessageGenerator::GenerateFieldAccessorDeclarations(io::Printer* printer) {
field); field);
} }
} else if (HasHasMethod(field)) { } else if (HasHasMethod(field)) {
format("$deprecated_attr$bool ${1$has_$name$$}$() const$2$\n", field, format(
"$deprecated_attr$bool ${1$has_$name$$}$() const$2$\n", field,
!IsFieldStripped(field, options_) ? ";" : " {__builtin_trap();}"); !IsFieldStripped(field, options_) ? ";" : " {__builtin_trap();}");
if (!IsFieldStripped(field, options_)) { if (!IsFieldStripped(field, options_)) {
format( format(
@ -1235,7 +1238,6 @@ void MessageGenerator::GenerateFieldAccessorDefinitions(io::Printer* printer) {
Formatter::SaveState saver(&format); Formatter::SaveState saver(&format);
format.AddMap(vars); format.AddMap(vars);
// Generate has_$name$() or $name$_size(). // Generate has_$name$() or $name$_size().
if (field->is_repeated()) { if (field->is_repeated()) {
if (IsFieldStripped(field, options_)) { if (IsFieldStripped(field, options_)) {

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -189,6 +189,10 @@
// Used to remove the manipulation of cleared elements in RepeatedPtrField. // Used to remove the manipulation of cleared elements in RepeatedPtrField.
// Owner: mkruskal@ // Owner: mkruskal@
#define PROTOBUF_FUTURE_REMOVE_CLEARED_API 1 #define PROTOBUF_FUTURE_REMOVE_CLEARED_API 1
// Used to escape C++20 keywords.
// Owner: mkruskal@
#define PROTOBUF_FUTURE_CPP20_KEYWORDS 1
#else #else
#define PROTOBUF_FUTURE_FINAL #define PROTOBUF_FUTURE_FINAL
#endif #endif
@ -196,7 +200,7 @@
#ifdef PROTOBUF_VERSION #ifdef PROTOBUF_VERSION
#error PROTOBUF_VERSION was previously defined #error PROTOBUF_VERSION was previously defined
#endif #endif
#define PROTOBUF_VERSION 3021001 #define PROTOBUF_VERSION 3021002
#ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC #ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
#error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined #error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -82,7 +82,7 @@ namespace internal {
// The current version, represented as a single integer to make comparison // The current version, represented as a single integer to make comparison
// easier: major * 10^6 + minor * 10^3 + micro // easier: major * 10^6 + minor * 10^3 + micro
#define GOOGLE_PROTOBUF_VERSION 3021001 #define GOOGLE_PROTOBUF_VERSION 3021002
// A suffix string for alpha, beta or rc releases. Empty for stable releases. // A suffix string for alpha, beta or rc releases. Empty for stable releases.
#define GOOGLE_PROTOBUF_VERSION_SUFFIX "" #define GOOGLE_PROTOBUF_VERSION_SUFFIX ""

@ -295,3 +295,9 @@ message EnumOnlyProto2 {
message OneStringProto2 { message OneStringProto2 {
optional string data = 1; optional string data = 1;
} }
message ProtoWithKeywords {
optional int32 inline = 1;
optional string concept = 2;
repeated string requires = 3;
}

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update
#error your headers. #error your headers.
#endif #endif
#if 3021001 < PROTOBUF_MIN_PROTOC_VERSION #if 3021002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is #error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc. #error regenerate this file with a newer version of protoc.

Loading…
Cancel
Save