[PATCH] D12471: Correct documentation for numSelectorArgs matcher

Dave Lee via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 31 15:27:45 PDT 2015


kastiglione added inline comments.

================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:2140-2153
@@ -2139,16 +2139,16 @@
 
 /// \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));
 ///  matches the invocation of "loadHTMLString:baseURL:" but not that
 ///  of self.bodyView
 /// \code
 ///     [self.bodyView loadHTMLString:html baseURL:NULL];
 /// \endcode
 AST_MATCHER_P(ObjCMessageExpr, numSelectorArgs, unsigned, N) {
   return Node.getSelector().getNumArgs() == N;
 }
    
----------------
klimek wrote:
> It seems like numSelectorArgs is missing unit tests - it might be good to add one, so we're sure the documented version now works and is tested :)
Thanks @klimek. Where are tests for ASTMatchers? I'm new to the codebase, I grepped for "matcher" in test/ but there are no relevant files.


http://reviews.llvm.org/D12471





More information about the cfe-commits mailing list