[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 28 15:45:26 PST 2021


steveire 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()) {
----------------
rsmith wrote:
> 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()`).
Please see https://reviews.llvm.org/D95644.


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