Commit b3c132f6 authored by Adam Cozzette's avatar Adam Cozzette Committed by Paul Yang

Avoid marking generated C++ messages as final for now (#5928)

We need to mark messages as final soon, but before we do that we need to
provide a temporary opt-out mechanism to accommodate existing code that
inherits from generated messages. For 3.7.1 let's stop marking messages
final but in 3.8 we can reintroduce "final" with an opt-out option.
parent 059851fe
...@@ -62,7 +62,7 @@ namespace protobuf { ...@@ -62,7 +62,7 @@ namespace protobuf {
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT Any final : class PROTOBUF_EXPORT Any :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {
public: public:
Any(); Any();
......
...@@ -71,7 +71,7 @@ namespace protobuf { ...@@ -71,7 +71,7 @@ namespace protobuf {
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT Api final : class PROTOBUF_EXPORT Api :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ {
public: public:
Api(); Api();
...@@ -262,7 +262,7 @@ class PROTOBUF_EXPORT Api final : ...@@ -262,7 +262,7 @@ class PROTOBUF_EXPORT Api final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Method final : class PROTOBUF_EXPORT Method :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ {
public: public:
Method(); Method();
...@@ -446,7 +446,7 @@ class PROTOBUF_EXPORT Method final : ...@@ -446,7 +446,7 @@ class PROTOBUF_EXPORT Method final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Mixin final : class PROTOBUF_EXPORT Mixin :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ {
public: public:
Mixin(); Mixin();
......
...@@ -246,7 +246,7 @@ bool HasPrivateHasMethod(const FieldDescriptor* field) { ...@@ -246,7 +246,7 @@ bool HasPrivateHasMethod(const FieldDescriptor* field) {
bool ShouldMarkClassAsFinal(const Descriptor* descriptor, bool ShouldMarkClassAsFinal(const Descriptor* descriptor,
const Options& options) { const Options& options) {
return true; return false;
} }
bool ShouldMarkClearAsFinal(const Descriptor* descriptor, bool ShouldMarkClearAsFinal(const Descriptor* descriptor,
......
...@@ -83,7 +83,7 @@ namespace compiler { ...@@ -83,7 +83,7 @@ namespace compiler {
// =================================================================== // ===================================================================
class PROTOC_EXPORT Version final : class PROTOC_EXPORT Version :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.Version) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.Version) */ {
public: public:
Version(); Version();
...@@ -236,7 +236,7 @@ class PROTOC_EXPORT Version final : ...@@ -236,7 +236,7 @@ class PROTOC_EXPORT Version final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOC_EXPORT CodeGeneratorRequest final : class PROTOC_EXPORT CodeGeneratorRequest :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorRequest) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorRequest) */ {
public: public:
CodeGeneratorRequest(); CodeGeneratorRequest();
...@@ -411,7 +411,7 @@ class PROTOC_EXPORT CodeGeneratorRequest final : ...@@ -411,7 +411,7 @@ class PROTOC_EXPORT CodeGeneratorRequest final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOC_EXPORT CodeGeneratorResponse_File final : class PROTOC_EXPORT CodeGeneratorResponse_File :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse.File) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse.File) */ {
public: public:
CodeGeneratorResponse_File(); CodeGeneratorResponse_File();
...@@ -572,7 +572,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : ...@@ -572,7 +572,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOC_EXPORT CodeGeneratorResponse final : class PROTOC_EXPORT CodeGeneratorResponse :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse) */ {
public: public:
CodeGeneratorResponse(); CodeGeneratorResponse();
......
This diff is collapsed.
...@@ -61,7 +61,7 @@ namespace protobuf { ...@@ -61,7 +61,7 @@ namespace protobuf {
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT Duration final : class PROTOBUF_EXPORT Duration :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Duration) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Duration) */ {
public: public:
Duration(); Duration();
......
...@@ -61,7 +61,7 @@ namespace protobuf { ...@@ -61,7 +61,7 @@ namespace protobuf {
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT Empty final : class PROTOBUF_EXPORT Empty :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ {
public: public:
Empty(); Empty();
......
...@@ -61,7 +61,7 @@ namespace protobuf { ...@@ -61,7 +61,7 @@ namespace protobuf {
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT FieldMask final : class PROTOBUF_EXPORT FieldMask :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldMask) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldMask) */ {
public: public:
FieldMask(); FieldMask();
......
...@@ -61,7 +61,7 @@ namespace protobuf { ...@@ -61,7 +61,7 @@ namespace protobuf {
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT SourceContext final : class PROTOBUF_EXPORT SourceContext :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceContext) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceContext) */ {
public: public:
SourceContext(); SourceContext();
......
...@@ -121,7 +121,7 @@ static bool _ParseMap(const char* begin, const char* end, void* object, ::google ...@@ -121,7 +121,7 @@ static bool _ParseMap(const char* begin, const char* end, void* object, ::google
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Struct final : class PROTOBUF_EXPORT Struct :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Struct) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Struct) */ {
public: public:
Struct(); Struct();
...@@ -257,7 +257,7 @@ class PROTOBUF_EXPORT Struct final : ...@@ -257,7 +257,7 @@ class PROTOBUF_EXPORT Struct final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Value final : class PROTOBUF_EXPORT Value :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Value) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Value) */ {
public: public:
Value(); Value();
...@@ -486,7 +486,7 @@ class PROTOBUF_EXPORT Value final : ...@@ -486,7 +486,7 @@ class PROTOBUF_EXPORT Value final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT ListValue final : class PROTOBUF_EXPORT ListValue :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ListValue) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ListValue) */ {
public: public:
ListValue(); ListValue();
......
...@@ -61,7 +61,7 @@ namespace protobuf { ...@@ -61,7 +61,7 @@ namespace protobuf {
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT Timestamp final : class PROTOBUF_EXPORT Timestamp :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Timestamp) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Timestamp) */ {
public: public:
Timestamp(); Timestamp();
......
...@@ -162,7 +162,7 @@ inline bool Syntax_Parse( ...@@ -162,7 +162,7 @@ inline bool Syntax_Parse(
} }
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT Type final : class PROTOBUF_EXPORT Type :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Type) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Type) */ {
public: public:
Type(); Type();
...@@ -375,7 +375,7 @@ class PROTOBUF_EXPORT Type final : ...@@ -375,7 +375,7 @@ class PROTOBUF_EXPORT Type final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Field final : class PROTOBUF_EXPORT Field :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Field) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Field) */ {
public: public:
Field(); Field();
...@@ -729,7 +729,7 @@ class PROTOBUF_EXPORT Field final : ...@@ -729,7 +729,7 @@ class PROTOBUF_EXPORT Field final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Enum final : class PROTOBUF_EXPORT Enum :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Enum) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Enum) */ {
public: public:
Enum(); Enum();
...@@ -919,7 +919,7 @@ class PROTOBUF_EXPORT Enum final : ...@@ -919,7 +919,7 @@ class PROTOBUF_EXPORT Enum final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT EnumValue final : class PROTOBUF_EXPORT EnumValue :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValue) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValue) */ {
public: public:
EnumValue(); EnumValue();
...@@ -1083,7 +1083,7 @@ class PROTOBUF_EXPORT EnumValue final : ...@@ -1083,7 +1083,7 @@ class PROTOBUF_EXPORT EnumValue final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Option final : class PROTOBUF_EXPORT Option :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Option) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Option) */ {
public: public:
Option(); Option();
......
...@@ -93,7 +93,7 @@ namespace protobuf { ...@@ -93,7 +93,7 @@ namespace protobuf {
// =================================================================== // ===================================================================
class PROTOBUF_EXPORT DoubleValue final : class PROTOBUF_EXPORT DoubleValue :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DoubleValue) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DoubleValue) */ {
public: public:
DoubleValue(); DoubleValue();
...@@ -220,7 +220,7 @@ class PROTOBUF_EXPORT DoubleValue final : ...@@ -220,7 +220,7 @@ class PROTOBUF_EXPORT DoubleValue final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT FloatValue final : class PROTOBUF_EXPORT FloatValue :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FloatValue) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FloatValue) */ {
public: public:
FloatValue(); FloatValue();
...@@ -347,7 +347,7 @@ class PROTOBUF_EXPORT FloatValue final : ...@@ -347,7 +347,7 @@ class PROTOBUF_EXPORT FloatValue final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Int64Value final : class PROTOBUF_EXPORT Int64Value :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int64Value) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int64Value) */ {
public: public:
Int64Value(); Int64Value();
...@@ -474,7 +474,7 @@ class PROTOBUF_EXPORT Int64Value final : ...@@ -474,7 +474,7 @@ class PROTOBUF_EXPORT Int64Value final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT UInt64Value final : class PROTOBUF_EXPORT UInt64Value :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt64Value) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt64Value) */ {
public: public:
UInt64Value(); UInt64Value();
...@@ -601,7 +601,7 @@ class PROTOBUF_EXPORT UInt64Value final : ...@@ -601,7 +601,7 @@ class PROTOBUF_EXPORT UInt64Value final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT Int32Value final : class PROTOBUF_EXPORT Int32Value :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int32Value) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int32Value) */ {
public: public:
Int32Value(); Int32Value();
...@@ -728,7 +728,7 @@ class PROTOBUF_EXPORT Int32Value final : ...@@ -728,7 +728,7 @@ class PROTOBUF_EXPORT Int32Value final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT UInt32Value final : class PROTOBUF_EXPORT UInt32Value :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt32Value) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt32Value) */ {
public: public:
UInt32Value(); UInt32Value();
...@@ -855,7 +855,7 @@ class PROTOBUF_EXPORT UInt32Value final : ...@@ -855,7 +855,7 @@ class PROTOBUF_EXPORT UInt32Value final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT BoolValue final : class PROTOBUF_EXPORT BoolValue :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BoolValue) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BoolValue) */ {
public: public:
BoolValue(); BoolValue();
...@@ -982,7 +982,7 @@ class PROTOBUF_EXPORT BoolValue final : ...@@ -982,7 +982,7 @@ class PROTOBUF_EXPORT BoolValue final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT StringValue final : class PROTOBUF_EXPORT StringValue :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.StringValue) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.StringValue) */ {
public: public:
StringValue(); StringValue();
...@@ -1126,7 +1126,7 @@ class PROTOBUF_EXPORT StringValue final : ...@@ -1126,7 +1126,7 @@ class PROTOBUF_EXPORT StringValue final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class PROTOBUF_EXPORT BytesValue final : class PROTOBUF_EXPORT BytesValue :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BytesValue) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BytesValue) */ {
public: public:
BytesValue(); BytesValue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment