================
@@ -150,6 +165,61 @@ makeReinitMatcher(const ValueDecl *MovedVariable,
.bind("reinit");
}
+static bool
+isVariableResetInLambda(const Stmt *Body, const ValueDecl *MovedVariable,
+ ASTContext *Context,
+ llvm::ArrayRef<StringRef> InvalidationFunctions) {
+ assert(Body && "There should be a lambda body");
+
+ // If the variable is not mentioned at all in the lambda body,
+ // it cannot be reinitialized.
+ const auto VariableMentionMatcher = stmt(anyOf(
+ hasDescendant(declRefExpr(hasDeclaration(equalsNode(MovedVariable)))),
+ hasDescendant(memberExpr(hasDeclaration(equalsNode(MovedVariable))))));
----------------
zwuis wrote:
Could be simplified with matcher `mapAnyOf`.
https://github.com/llvm/llvm-project/pull/173192
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits