[cfe-commits] r166921 - in /cfe/trunk/unittests/ASTMatchers: ASTMatchersTest.cpp ASTMatchersTest.h

Daniel Jasper djasper at google.com
Mon Oct 29 03:48:25 PDT 2012


Author: djasper
Date: Mon Oct 29 05:48:25 2012
New Revision: 166921

URL: http://llvm.org/viewvc/llvm-project?rev=166921&view=rev
Log:
Fix ASTMatchersTests to not create an overloaded-virtual warning.

Modified:
    cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
    cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h

Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp?rev=166921&r1=166920&r2=166921&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp Mon Oct 29 05:48:25 2012
@@ -599,6 +599,10 @@
     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 @@
   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;

Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h?rev=166921&r1=166920&r2=166921&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h Mon Oct 29 05:48:25 2012
@@ -24,10 +24,8 @@
 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





More information about the cfe-commits mailing list