This is an archive of the discontinued LLVM Phabricator instance.

Correct documentation for numSelectorArgs matcher
ClosedPublic

Authored by kastiglione on Aug 29 2015, 9:30 PM.

Details

Summary

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

Diff Detail

Event Timeline

kastiglione retitled this revision from to Correct documentation for numSelectorArgs matcher.
kastiglione updated this object.
kastiglione added a reviewer: modocache.
kastiglione added a subscriber: cfe-commits.
klimek added inline comments.Aug 30 2015, 6:28 AM
include/clang/ASTMatchers/ASTMatchers.h
2140–2153

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

kastiglione added inline comments.Aug 31 2015, 3:27 PM
include/clang/ASTMatchers/ASTMatchers.h
2140–2153

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.

Add test case for numSelectorArgs(0)

kastiglione marked 2 inline comments as done.Aug 31 2015, 9:48 PM
kastiglione updated this object.Aug 31 2015, 9:49 PM

+Dean, as I really don't know Obj-C (sorry for the delay in reply, was on vacation)

Thanks @klimek! There's certainly no rush on a diff like this :P

klimek accepted this revision.Sep 8 2015, 3:13 AM
klimek added a reviewer: klimek.

LG, as this is a documentation change that looks about right, and comes with tests, and the original author doesn't jump in.

This revision is now accepted and ready to land.Sep 8 2015, 3:13 AM
klimek closed this revision.Sep 8 2015, 3:14 AM

Committed as r246998.