[C++] Remove all warnings from clang
diff --git a/expr.cc b/expr.cc
index a8f306c..3da740e 100644
--- a/expr.cc
+++ b/expr.cc
@@ -62,7 +62,7 @@
s->append(s_.begin(), s_.end());
}
- virtual bool IsLiteral() const { return true; }
+ virtual bool IsLiteral() const override { return true; }
virtual string DebugString_() const override {
return s_.as_string();
@@ -109,7 +109,7 @@
return r;
}
- virtual Value* Compact() {
+ virtual Value* Compact() override {
if (vals_.size() != 1) {
return this;
}
diff --git a/find.cc b/find.cc
index 4c7cd8f..b783acb 100644
--- a/find.cc
+++ b/find.cc
@@ -154,7 +154,7 @@
virtual bool RunFind(const FindCommand& fc, int d,
string* path,
unordered_map<const DirentNode*, string>*,
- string* out) const {
+ string* out) const override {
PrintIfNecessary(fc, *path, type_, d, out);
return true;
}
@@ -205,7 +205,7 @@
}
}
- virtual const DirentNode* FindDir(StringPiece d) const {
+ virtual const DirentNode* FindDir(StringPiece d) const override {
if (d.empty() || d == ".")
return this;
size_t index = d.find('/');
@@ -224,7 +224,7 @@
virtual bool RunFind(const FindCommand& fc, int d,
string* path,
unordered_map<const DirentNode*, string>* cur_read_dirs,
- string* out) const {
+ string* out) const override {
ScopedReadDirTracker srdt(this, *path, cur_read_dirs);
if (!srdt.ok()) {
fprintf(stderr, "FindEmulator: find: File system loop detected; `%s' is "
@@ -308,7 +308,7 @@
: DirentNode(name), to_(NULL), errno_(0) {
}
- virtual const DirentNode* FindDir(StringPiece d) const {
+ virtual const DirentNode* FindDir(StringPiece d) const override {
if (errno_ == 0 && to_)
return to_->FindDir(d);
return NULL;
@@ -317,7 +317,7 @@
virtual bool RunFind(const FindCommand& fc, int d,
string* path,
unordered_map<const DirentNode*, string>* cur_read_dirs,
- string* out) const {
+ string* out) const override {
unsigned char type = DT_LNK;
if (fc.follows_symlinks && errno_ != ENOENT) {
if (errno_) {
diff --git a/var.h b/var.h
index c3bb233..5ba5fcb 100644
--- a/var.h
+++ b/var.h
@@ -65,16 +65,16 @@
explicit SimpleVar(VarOrigin origin);
SimpleVar(const string& v, VarOrigin origin);
- virtual const char* Flavor() const {
+ virtual const char* Flavor() const override {
return "simple";
}
- virtual VarOrigin Origin() const {
+ virtual VarOrigin Origin() const override {
return origin_;
}
virtual void Eval(Evaluator* ev, string* s) const override;
- virtual void AppendVar(Evaluator* ev, Value* v);
+ virtual void AppendVar(Evaluator* ev, Value* v) override;
virtual StringPiece String() const override;
@@ -91,16 +91,16 @@
public:
RecursiveVar(Value* v, VarOrigin origin, StringPiece orig);
- virtual const char* Flavor() const {
+ virtual const char* Flavor() const override {
return "recursive";
}
- virtual VarOrigin Origin() const {
+ virtual VarOrigin Origin() const override {
return origin_;
}
virtual void Eval(Evaluator* ev, string* s) const override;
- virtual void AppendVar(Evaluator* ev, Value* v);
+ virtual void AppendVar(Evaluator* ev, Value* v) override;
virtual StringPiece String() const override;
@@ -116,13 +116,13 @@
public:
UndefinedVar();
- virtual const char* Flavor() const {
+ virtual const char* Flavor() const override {
return "undefined";
}
- virtual VarOrigin Origin() const {
+ virtual VarOrigin Origin() const override {
return VarOrigin::UNDEFINED;
}
- virtual bool IsDefined() const { return false; }
+ virtual bool IsDefined() const override { return false; }
virtual void Eval(Evaluator* ev, string* s) const override;
@@ -141,19 +141,19 @@
delete v_;
}
- virtual const char* Flavor() const {
+ virtual const char* Flavor() const override {
return v_->Flavor();
}
- virtual VarOrigin Origin() const {
+ virtual VarOrigin Origin() const override {
return v_->Origin();
}
- virtual bool IsDefined() const {
+ virtual bool IsDefined() const override {
return v_->IsDefined();
}
- virtual void Eval(Evaluator* ev, string* s) const {
+ virtual void Eval(Evaluator* ev, string* s) const override {
v_->Eval(ev, s);
}
- virtual void AppendVar(Evaluator* ev, Value* v) {
+ virtual void AppendVar(Evaluator* ev, Value* v) override {
v_->AppendVar(ev, v);
}
virtual StringPiece String() const override {