[PATCH] D102213: [ASTMatchers] Add forCallable(), a generalization of forFunction().

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 12 12:16:30 PDT 2021


NoQ added a comment.

The breakage is loud; the code will no longer compile when the intermediate `decl()` (or `namedDecl()`, or whatever) is not present. The more annoying part is that when you add `namedDecl()` back (or if you had it spelled out this way from the start, which doesn't make much sense but is valid and shorter than spelling out `functionDecl()`), your `Node.get<FunctionDecl>()` in the match callback will silently start returning null (on anything that isn't a `functionDecl()`) which may lead to unexpected crashes (previously there was no match at all, now there's a match but the node isn't of the expected type). So a relatively distant piece of code will require manual audit in order to address the potential breakage.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102213/new/

https://reviews.llvm.org/D102213



More information about the cfe-commits mailing list