kastiglione updated this revision to Diff 33665.
kastiglione added a comment.

Add test case for numSelectorArgs(0)


http://reviews.llvm.org/D12471

Files:
  include/clang/ASTMatchers/ASTMatchers.h
  unittests/ASTMatchers/ASTMatchersTest.cpp

Index: unittests/ASTMatchers/ASTMatchersTest.cpp
===================================================================
--- unittests/ASTMatchers/ASTMatchersTest.cpp
+++ unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -4870,6 +4870,9 @@
       objcMessageExpr(hasSelector("contents"), hasUnarySelector())));
   EXPECT_TRUE(matchesObjC(
       Objc1String,
+      objcMessageExpr(hasSelector("contents"), numSelectorArgs(0))));
+  EXPECT_TRUE(matchesObjC(
+      Objc1String,
       objcMessageExpr(matchesSelector("uppercase*"),
                       argumentCountIs(0)
                       )));
Index: include/clang/ASTMatchers/ASTMatchers.h
===================================================================
--- include/clang/ASTMatchers/ASTMatchers.h
+++ include/clang/ASTMatchers/ASTMatchers.h
@@ -2139,7 +2139,7 @@
 
 /// \brief Matches when the selector has the specified number of arguments
 ///
-///  matcher = objCMessageExpr(numSelectorArgs(1));
+///  matcher = objCMessageExpr(numSelectorArgs(0));
 ///  matches self.bodyView in the code below
 ///
 ///  matcher = objCMessageExpr(numSelectorArgs(2));


Index: unittests/ASTMatchers/ASTMatchersTest.cpp
===================================================================
--- unittests/ASTMatchers/ASTMatchersTest.cpp
+++ unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -4870,6 +4870,9 @@
       objcMessageExpr(hasSelector("contents"), hasUnarySelector())));
   EXPECT_TRUE(matchesObjC(
       Objc1String,
+      objcMessageExpr(hasSelector("contents"), numSelectorArgs(0))));
+  EXPECT_TRUE(matchesObjC(
+      Objc1String,
       objcMessageExpr(matchesSelector("uppercase*"),
                       argumentCountIs(0)
                       )));
Index: include/clang/ASTMatchers/ASTMatchers.h
===================================================================
--- include/clang/ASTMatchers/ASTMatchers.h
+++ include/clang/ASTMatchers/ASTMatchers.h
@@ -2139,7 +2139,7 @@
 
 /// \brief Matches when the selector has the specified number of arguments
 ///
-///  matcher = objCMessageExpr(numSelectorArgs(1));
+///  matcher = objCMessageExpr(numSelectorArgs(0));
 ///  matches self.bodyView in the code below
 ///
 ///  matcher = objCMessageExpr(numSelectorArgs(2));
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to