Skip to content
Snippets Groups Projects
Commit 1b8011a8 authored by Manuel Klimek's avatar Manuel Klimek
Browse files

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246998 91177308-0d34-0410-b5e6-96231b3b80d8
parent 7d83f25a
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
......@@ -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*"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment