This patch enables matching for FunctionDecls that have bodies.
The examples and test code you use seem to imply that the isDefinition() matcher may be all you need; is isDefinition() insufficient for some reason? If so, can you expand the test cases to cover that particular usage? Also, FunctionDecl::getBody() does more work than FunctionDecl::hasBody() -- it would be better to implement the AST matcher in terms of FunctionDecl::hasBody() instead.
Indentation here is incorrect, you should run clang-format over the patch.
|342 ↗||(On Diff #45232)|
The specialization should live in the header file, not the source file.
|344 ↗||(On Diff #45232)|
I would use Node.doesThisDeclarationHaveABody() instead; otherwise this will match definitions that are explicitly deleted, which isn't particularly useful.