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

Loading…
Cancel
Save