diff options
author | Khuzema Pithewan <khuzemap@gmail.com> | 2018-05-21 15:16:34 -0700 |
---|---|---|
committer | Khuzema Pithewan <khuzemap@gmail.com> | 2018-06-19 11:03:01 -0700 |
commit | 6f88e12f9dee4a658913b475e7680952c6ff3cac (patch) | |
tree | fb9690e6928deb21cb6df6558d4405a61aede251 /src/google/protobuf/message.h | |
parent | 2213c1c1f6bae29513729b7285462b24df20d687 (diff) |
Add "override" for overridden virtual functions
Add "override" for overridden virtual functions.
Please refer following issue for discussion on this.
https://github.com/google/protobuf/issues/67
Diffstat (limited to 'src/google/protobuf/message.h')
-rw-r--r-- | src/google/protobuf/message.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h index f3d1a58a..4bdda3ad 100644 --- a/src/google/protobuf/message.h +++ b/src/google/protobuf/message.h @@ -196,12 +196,12 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite { // Construct a new instance of the same type. Ownership is passed to the // caller. (This is also defined in MessageLite, but is defined again here // for return-type covariance.) - virtual Message* New() const = 0; + virtual Message* New() const override = 0; // Construct a new instance on the arena. Ownership is passed to the caller // if arena is a NULL. Default implementation allows for API compatibility // during the Arena transition. - virtual Message* New(::google::protobuf::Arena* arena) const { + virtual Message* New(::google::protobuf::Arena* arena) const override { Message* message = New(); if (arena != NULL) { arena->Own(message); @@ -233,7 +233,7 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite { // Like FindInitializationErrors, but joins all the strings, delimited by // commas, and returns them. - string InitializationErrorString() const; + string InitializationErrorString() const override; // Clears all unknown fields from this message and all embedded messages. // Normally, if unknown tag numbers are encountered when parsing a message, @@ -305,13 +305,13 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite { // These methods are pure-virtual in MessageLite, but Message provides // reflection-based default implementations. - virtual string GetTypeName() const; - virtual void Clear(); - virtual bool IsInitialized() const; - virtual void CheckTypeAndMergeFrom(const MessageLite& other); - virtual bool MergePartialFromCodedStream(io::CodedInputStream* input); - virtual size_t ByteSizeLong() const; - virtual void SerializeWithCachedSizes(io::CodedOutputStream* output) const; + virtual string GetTypeName() const override; + virtual void Clear() override; + virtual bool IsInitialized() const override; + virtual void CheckTypeAndMergeFrom(const MessageLite& other) override; + virtual bool MergePartialFromCodedStream(io::CodedInputStream* input) override; + virtual size_t ByteSizeLong() const override; + virtual void SerializeWithCachedSizes(io::CodedOutputStream* output) const override; private: // This is called only by the default implementation of ByteSize(), to |