diff options
author | Daniel Jasper <djasper@google.com> | 2012-10-29 10:48:25 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2012-10-29 10:48:25 +0000 |
commit | 452abbc76b775169dc01c359e94a7f666ebc8692 (patch) | |
tree | e416d70cf61cbb3e53b0bd6bfafb622c7b56c89e | |
parent | a267cf6f87dc695143d65fc61ec1744564f55932 (diff) |
Fix ASTMatchersTests to not create an overloaded-virtual warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166921 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.cpp | 9 | ||||
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.h | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 2602e87840..ec4312e52e 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -599,6 +599,10 @@ public: return false; } + virtual bool run(const BoundNodes *Nodes, ASTContext *Context) { + return run(Nodes); + } + private: const std::string Id; const int ExpectedCount; @@ -3238,6 +3242,11 @@ public: explicit VerifyRecursiveMatch(StringRef Id, const internal::Matcher<T> &InnerMatcher) : Id(Id), InnerMatcher(InnerMatcher) {} + + virtual bool run(const BoundNodes *Nodes) { + return false; + } + virtual bool run(const BoundNodes *Nodes, ASTContext *Context) { const T *Node = Nodes->getNodeAs<T>(Id); bool Found = false; diff --git a/unittests/ASTMatchers/ASTMatchersTest.h b/unittests/ASTMatchers/ASTMatchersTest.h index 66cc9bd450..5e63b6bb11 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.h +++ b/unittests/ASTMatchers/ASTMatchersTest.h @@ -24,10 +24,8 @@ using clang::tooling::FrontendActionFactory; class BoundNodesCallback { public: virtual ~BoundNodesCallback() {} - virtual bool run(const BoundNodes *BoundNodes) { return false; } - virtual bool run(const BoundNodes *BoundNodes, ASTContext *Context) { - return run(BoundNodes); - } + virtual bool run(const BoundNodes *BoundNodes) = 0; + virtual bool run(const BoundNodes *BoundNodes, ASTContext *Context) = 0; }; // If 'FindResultVerifier' is not NULL, sets *Verified to the result of |