Fix documentation of numSelectorArgs.

Currently, the documentation for numSelectorArgs includes an incorrect
example. It shows a case where an argument of 1 will match a property
getter, but a getter will be matched only when N == 0.

This diff corrects the documentation and adds a test for numSelectorArgs(0).

Patch by Dave Lee.

llvm-svn: 246998
This commit is contained in:
Manuel Klimek 2015-09-08 10:11:26 +00:00
parent 7cd4810021
commit e67a9d6d24
2 changed files with 4 additions and 1 deletions

View File

@ -2151,7 +2151,7 @@ AST_MATCHER(ObjCMessageExpr, hasKeywordSelector) {
/// \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));

View File

@ -4888,6 +4888,9 @@ TEST(ObjCMessageExprMatcher, SimpleExprs) {
EXPECT_TRUE(matchesObjC(
Objc1String,
objcMessageExpr(hasSelector("contents"), hasUnarySelector())));
EXPECT_TRUE(matchesObjC(
Objc1String,
objcMessageExpr(hasSelector("contents"), numSelectorArgs(0))));
EXPECT_TRUE(matchesObjC(
Objc1String,
objcMessageExpr(matchesSelector("uppercase*"),