[clang] [webkit.UncountedLambdaCapturesChecker] Treat a call to lambda function via a variable as safe. (PR #135688)
Rashmi Mudduluru via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 24 14:48:46 PDT 2025
================
@@ -372,6 +372,14 @@ void trivial_lambda() {
trivial_lambda();
}
+bool call_lambda_var_decl() {
+ RefCountable* ref_countable = make_obj();
+ auto lambda = [&]() -> bool {
+ return ref_countable->next();
+ };
+ return lambda();
+}
+
----------------
t-rasmud wrote:
Maybe add a test for capture by copy also? (for completeness)
https://github.com/llvm/llvm-project/pull/135688
More information about the cfe-commits
mailing list