[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 28 14:55:01 PST 2021
rsmith added inline comments.
================
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2063-2065
+ if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
+ if (const CXXRecordDecl *RD = MD->getParent()) {
+ if (RD->isLambda()) {
----------------
This is incorrectly skipping the bodies of all other lambda member functions (default ctor, copy ctor, destructor, implicit conversion to function pointer type), not only the "body" of the lambda itself (the definition of the `operator()`).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95573/new/
https://reviews.llvm.org/D95573
More information about the cfe-commits
mailing list