Skip to content

Commit

Permalink
Breaking change: Remove deprecated syntax APIs
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 588848125
  • Loading branch information
mkruskal-google authored and copybara-github committed Dec 7, 2023
1 parent b7a37e2 commit 715b543
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions src/google/protobuf/descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 715b543

Please sign in to comment.