[PATCH] D12471: Correct documentation for numSelectorArgs matcher

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 30 06:28:07 PDT 2015


klimek 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;
 }
    
----------------
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 :)


http://reviews.llvm.org/D12471





More information about the cfe-commits mailing list