aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2018-06-25 13:52:55 -0700
committerGravatar GitHub <noreply@github.com>2018-06-25 13:52:55 -0700
commit0b0890b36d01bf7b372cb237998ee793f5cdc433 (patch)
tree20f4e0b1ad1f74f794f2cb45110841f2b26af23b /src/google/protobuf/compiler
parentd9ccd0c0e6bbda9bf4476088eeb46b02d7dcd327 (diff)
parent6f88e12f9dee4a658913b475e7680952c6ff3cac (diff)
Merge pull request #4608 from khuzemap/master
Add "override" keyword for overridden virtual functions
Diffstat (limited to 'src/google/protobuf/compiler')
-rw-r--r--src/google/protobuf/compiler/importer.cc2
-rw-r--r--src/google/protobuf/compiler/importer.h15
2 files changed, 9 insertions, 8 deletions
diff --git a/src/google/protobuf/compiler/importer.cc b/src/google/protobuf/compiler/importer.cc
index c3831e72..58498aaa 100644
--- a/src/google/protobuf/compiler/importer.cc
+++ b/src/google/protobuf/compiler/importer.cc
@@ -103,7 +103,7 @@ class SourceTreeDescriptorDatabase::SingleFileErrorCollector
bool had_errors() { return had_errors_; }
// implements ErrorCollector ---------------------------------------
- void AddError(int line, int column, const string& message) {
+ void AddError(int line, int column, const string& message) override {
if (multi_file_error_collector_ != NULL) {
multi_file_error_collector_->AddError(filename_, line, column, message);
}
diff --git a/src/google/protobuf/compiler/importer.h b/src/google/protobuf/compiler/importer.h
index a4ffcf87..bf6d3de3 100644
--- a/src/google/protobuf/compiler/importer.h
+++ b/src/google/protobuf/compiler/importer.h
@@ -96,12 +96,13 @@ class LIBPROTOBUF_EXPORT SourceTreeDescriptorDatabase : public DescriptorDatabas
}
// implements DescriptorDatabase -----------------------------------
- bool FindFileByName(const string& filename, FileDescriptorProto* output);
+ bool FindFileByName(const string& filename,
+ FileDescriptorProto* output) override;
bool FindFileContainingSymbol(const string& symbol_name,
- FileDescriptorProto* output);
+ FileDescriptorProto*output) override;
bool FindFileContainingExtension(const string& containing_type,
int field_number,
- FileDescriptorProto* output);
+ FileDescriptorProto* output) override;
private:
class SingleFileErrorCollector;
@@ -119,13 +120,13 @@ class LIBPROTOBUF_EXPORT SourceTreeDescriptorDatabase : public DescriptorDatabas
const string& element_name,
const Message* descriptor,
ErrorLocation location,
- const string& message);
+ const string& message) override;
virtual void AddWarning(const string& filename,
const string& element_name,
const Message* descriptor,
ErrorLocation location,
- const string& message);
+ const string& message) override;
private:
SourceTreeDescriptorDatabase* owner_;
@@ -293,9 +294,9 @@ class LIBPROTOBUF_EXPORT DiskSourceTree : public SourceTree {
bool VirtualFileToDiskFile(const string& virtual_file, string* disk_file);
// implements SourceTree -------------------------------------------
- virtual io::ZeroCopyInputStream* Open(const string& filename);
+ virtual io::ZeroCopyInputStream* Open(const string& filename) override;
- virtual string GetLastErrorMessage();
+ virtual string GetLastErrorMessage() override;
private:
struct Mapping {