[clang] [Clang] Check for uninitialized use in lambda within CXXOperatorCallExpr (PR #129198)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 7 16:51:16 PST 2025


================
@@ -892,6 +892,11 @@ namespace lambdas {
       return a1.x;
     });
     A a2([&] { return a2.x; }); // ok
+    A a3([=] { return a3.x; }()); // expected-warning{{variable 'a3' is uninitialized when used within its own initialization}}
----------------
shafik wrote:

Do we now also catch this case: https://godbolt.org/z/bnYEqhqY9

https://github.com/llvm/llvm-project/pull/129198


More information about the cfe-commits mailing list