diff options
| author | Alexander Kornienko <alexfh@google.com> | 2015-04-11 02:00:23 +0000 |
|---|---|---|
| committer | Alexander Kornienko <alexfh@google.com> | 2015-04-11 02:00:23 +0000 |
| commit | 34eb20725d9d923f6f2ff9f205f198d5f3df022b (patch) | |
| tree | 4edc0a751e1e64c8fd953053d1a230ac09e16eae /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
| parent | af7d76c7204c0a586fd38fff45ffe0bd284593b0 (diff) | |
| download | bcm5719-llvm-34eb20725d9d923f6f2ff9f205f198d5f3df022b.tar.gz bcm5719-llvm-34eb20725d9d923f6f2ff9f205f198d5f3df022b.zip | |
Use 'override/final' instead of 'virtual' for overridden methods
Summary:
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D8926
llvm-svn: 234678
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 7edec96c0f3..4b0580a8147 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -747,12 +747,12 @@ public: Name.clear(); } - ~VerifyIdIsBoundTo() { + ~VerifyIdIsBoundTo() override { EXPECT_EQ(0, Count); EXPECT_EQ("", Name); } - virtual bool run(const BoundNodes *Nodes) override { + bool run(const BoundNodes *Nodes) override { const BoundNodes::IDToNodeMap &M = Nodes->getMap(); if (Nodes->getNodeAs<T>(Id)) { ++Count; @@ -774,7 +774,7 @@ public: return false; } - virtual bool run(const BoundNodes *Nodes, ASTContext *Context) override { + bool run(const BoundNodes *Nodes, ASTContext *Context) override { return run(Nodes); } @@ -4379,9 +4379,9 @@ public: : Id(Id), InnerMatcher(InnerMatcher), InnerId(InnerId) { } - virtual bool run(const BoundNodes *Nodes) { return false; } + bool run(const BoundNodes *Nodes) override { return false; } - virtual bool run(const BoundNodes *Nodes, ASTContext *Context) { + bool run(const BoundNodes *Nodes, ASTContext *Context) override { const T *Node = Nodes->getNodeAs<T>(Id); return selectFirst<T>(InnerId, match(InnerMatcher, *Node, *Context)) != nullptr; @@ -4430,9 +4430,9 @@ TEST(MatchFinder, CanMatchSingleNodesRecursively) { template <typename T> class VerifyAncestorHasChildIsEqual : public BoundNodesCallback { public: - virtual bool run(const BoundNodes *Nodes) { return false; } + bool run(const BoundNodes *Nodes) override { return false; } - virtual bool run(const BoundNodes *Nodes, ASTContext *Context) { + bool run(const BoundNodes *Nodes, ASTContext *Context) override { const T *Node = Nodes->getNodeAs<T>(""); return verify(*Nodes, *Context, Node); } @@ -4488,12 +4488,10 @@ TEST(MatchFinder, CheckProfiling) { class VerifyStartOfTranslationUnit : public MatchFinder::MatchCallback { public: VerifyStartOfTranslationUnit() : Called(false) {} - virtual void run(const MatchFinder::MatchResult &Result) { + void run(const MatchFinder::MatchResult &Result) override { EXPECT_TRUE(Called); } - virtual void onStartOfTranslationUnit() { - Called = true; - } + void onStartOfTranslationUnit() override { Called = true; } bool Called; }; @@ -4516,12 +4514,10 @@ TEST(MatchFinder, InterceptsStartOfTranslationUnit) { class VerifyEndOfTranslationUnit : public MatchFinder::MatchCallback { public: VerifyEndOfTranslationUnit() : Called(false) {} - virtual void run(const MatchFinder::MatchResult &Result) { + void run(const MatchFinder::MatchResult &Result) override { EXPECT_FALSE(Called); } - virtual void onEndOfTranslationUnit() { - Called = true; - } + void onEndOfTranslationUnit() override { Called = true; } bool Called; }; |

