[ASTMatchers] Add forCallable(), a generalization of forFunction().
The new matcher additionally covers blocks and Objective-C methods. This matcher actually makes sure that the statement truly belongs to that declaration's body. forFunction() incorrectly reported that a statement in a nested block belonged to the surrounding function. forFunction() is now deprecated due to the above footgun, in favor of forCallable(functionDecl()) when only functions need to be considered. Differential Revision: https://reviews.llvm.org/D102213
Loading
Please sign in to comment