Breaking change: Remove deprecated syntax APIs

PiperOrigin-RevId: 588848125
pull/14993/head
Mike Kruskal 12 months ago committed by Copybara-Service
parent b7a37e2860
commit 715b543e04
  1. 27
      src/google/protobuf/descriptor.h

@ -1036,17 +1036,10 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase,
friend class Reflection;
friend class FieldDescriptorLegacy;
public:
ABSL_DEPRECATED(
"Syntax is deprecated in favor of editions, please use "
"FieldDescriptor::has_presence instead.")
// Returns true if this field was syntactically written with "optional" in the
// .proto file. Excludes singular proto3 fields that do not have a label.
bool has_optional_keyword() const;
private:
// Get the merged features that apply to this field. These are specified in
// the .proto file through the feature options in the message definition.
// Allowed features are defined by Features in descriptor.proto, along with
@ -1219,17 +1212,10 @@ class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase {
friend class compiler::cpp::Formatter;
friend class OneofDescriptorLegacy;
public:
ABSL_DEPRECATED(
"Syntax is deprecated in favor of editions, please use "
"real_oneof_decl_count for now instead of is_synthetic.")
// Returns whether this oneof was inserted by the compiler to wrap a proto3
// optional field. If this returns true, code generators should *not* emit it.
bool is_synthetic() const;
private:
// Get the merged features that apply to this oneof. These are specified in
// the .proto file through the feature options in the oneof definition.
// Allowed features are defined by Features in descriptor.proto, along with
@ -1869,18 +1855,12 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase {
// descriptor.proto, and any available extensions of that message.
const FileOptions& options() const;
private:
// With the upcoming release of editions, syntax should not be used for
// business logic. Instead, the various feature helpers defined in this file
// should be used to query more targeted behaviors. For example:
// has_presence, is_closed, requires_utf8_validation.
enum
ABSL_DEPRECATED(
"Syntax is deprecated in favor of editions. Please use targeted "
"feature helpers instead (e.g. has_presence, is_packed, "
"requires_utf8_validation, etc).")
Syntax
enum Syntax
#ifndef SWIG
: int
#endif // !SWIG
@ -1891,10 +1871,6 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase {
SYNTAX_EDITIONS = 99,
};
PROTOBUF_IGNORE_DEPRECATION_START
ABSL_DEPRECATED(
"Syntax is deprecated in favor of editions. Please use targeted "
"feature helpers instead (e.g. has_presence, is_packed, "
"requires_utf8_validation, etc).")
Syntax syntax() const;
PROTOBUF_IGNORE_DEPRECATION_STOP
@ -1903,7 +1879,6 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase {
friend class FileDescriptorLegacy;
PROTOBUF_IGNORE_DEPRECATION_START
ABSL_DEPRECATED("Syntax is deprecated in favor of editions")
static const char* SyntaxName(Syntax syntax);
PROTOBUF_IGNORE_DEPRECATION_STOP

Loading…
Cancel
Save