diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp index 3295ad1e21455..ebf548eb25431 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp @@ -2030,8 +2030,6 @@ TEST_P(ASTMatchersTest, template class VerifyAncestorHasChildIsEqual : public BoundNodesCallback { public: - bool run(const BoundNodes *Nodes) override { return false; } - bool run(const BoundNodes *Nodes, ASTContext *Context) override { const T *Node = Nodes->getNodeAs(""); return verify(*Nodes, *Context, Node); diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.h b/clang/unittests/ASTMatchers/ASTMatchersTest.h index e981299531574..ad2f5f355621c 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.h +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.h @@ -28,7 +28,6 @@ using clang::tooling::runToolOnCodeWithArgs; class BoundNodesCallback { public: virtual ~BoundNodesCallback() {} - virtual bool run(const BoundNodes *BoundNodes) = 0; virtual bool run(const BoundNodes *BoundNodes, ASTContext *Context) = 0; virtual void onEndOfTranslationUnit() {} }; @@ -403,7 +402,7 @@ template class VerifyIdIsBoundTo : public BoundNodesCallback { EXPECT_EQ("", Name); } - bool run(const BoundNodes *Nodes) override { + bool run(const BoundNodes *Nodes, ASTContext * /*Context*/) override { const BoundNodes::IDToNodeMap &M = Nodes->getMap(); if (Nodes->getNodeAs(Id)) { ++Count; @@ -426,10 +425,6 @@ template class VerifyIdIsBoundTo : public BoundNodesCallback { return false; } - bool run(const BoundNodes *Nodes, ASTContext *Context) override { - return run(Nodes); - } - private: const std::string Id; const int ExpectedCount; diff --git a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp index 3c033638960de..d887c5ba8f05f 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp @@ -5641,7 +5641,6 @@ TEST(HasParent, MatchesAllParents) { TEST(HasParent, NoDuplicateParents) { class HasDuplicateParents : public BoundNodesCallback { public: - bool run(const BoundNodes *Nodes) override { return false; } bool run(const BoundNodes *Nodes, ASTContext *Context) override { const Stmt *Node = Nodes->getNodeAs("node"); std::set Parents; @@ -5850,16 +5849,14 @@ template class VerifyMatchOnNode : public BoundNodesCallback { public: VerifyMatchOnNode(StringRef Id, const internal::Matcher &InnerMatcher, StringRef InnerId) - : Id(Id), InnerMatcher(InnerMatcher), InnerId(InnerId) { - } - - bool run(const BoundNodes *Nodes) override { return false; } + : Id(Id), InnerMatcher(InnerMatcher), InnerId(InnerId) {} bool run(const BoundNodes *Nodes, ASTContext *Context) override { const T *Node = Nodes->getNodeAs(Id); return selectFirst(InnerId, match(InnerMatcher, *Node, *Context)) != - nullptr; + nullptr; } + private: std::string Id; internal::Matcher InnerMatcher; @@ -6053,7 +6050,7 @@ namespace { class ForCallablePreservesBindingWithMultipleParentsTestCallback : public BoundNodesCallback { public: - bool run(const BoundNodes *BoundNodes) override { + bool run(const BoundNodes *BoundNodes, ASTContext *Context) override { FunctionDecl const *FunDecl = BoundNodes->getNodeAs("funDecl"); // Validate test assumptions. This would be expressed as ASSERT_* in @@ -6090,10 +6087,6 @@ class ForCallablePreservesBindingWithMultipleParentsTestCallback return true; } - bool run(const BoundNodes *BoundNodes, ASTContext *Context) override { - return run(BoundNodes); - } - private: void ExpectCorrectResult(StringRef LogInfo, ArrayRef Results) const {