================
@@ -397,6 +474,30 @@ void UseAfterMoveFinder::getReinits(
DeclRefs->insert(TheDeclRef);
}
}
+
+ // Check for calls to lambdas that capture the moved variable
+ // by reference and reinitialize it within their body.
+ const SmallVector<BoundNodes, 1> LambdaMatches =
+ match(findAll(LambdaCallMatcher), *S->getStmt(), *Context);
+
+ for (const auto &Match : LambdaMatches) {
+ const auto *Operator =
+ Match.getNodeAs<CXXOperatorCallExpr>("lambda-call");
+
+ if (Operator && BlockMap->blockContainingStmt(Operator) == Block) {
+ const auto *MD =
+ dyn_cast_or_null<CXXMethodDecl>(Operator->getDirectCallee());
----------------
zwuis wrote:
Can we remove `dyn_` and/or `_or_null`?
https://github.com/llvm/llvm-project/pull/173192
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits