[PATCH] D12471: Correct documentation for numSelectorArgs matcher

Dave Lee via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 31 21:48:00 PDT 2015


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));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12471.33665.patch
Type: text/x-patch
Size: 1111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150901/5782292a/attachment.bin>


More information about the cfe-commits mailing list