[clang] [LifetimeSafety] Use buildOriginFlowChain for remaining diagnostics in issuePendingWarnings (PR #212083)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 8 00:38:41 PDT 2026
================
@@ -2337,8 +2374,9 @@ auto capture_int_by_value() {
auto capture_view_by_value() {
MyObj obj;
View v(obj); // expected-warning {{stack memory associated with local variable 'obj' is returned}}
- auto lambda = [v]() { return v; };
- return lambda; // expected-note {{returned here}}
+ auto lambda = [v]() { return v; }; // expected-note {{local variable 'v' aliases the storage of local variable 'obj'}}
+ return lambda; // expected-note {{returned here}} \
+ // expected-note {{local variable 'lambda' aliases the storage of local variable 'obj'}}
----------------
NeKon69 wrote:
There are still a couple of unaligned diagnostics starting from here.
https://github.com/llvm/llvm-project/pull/212083
More information about the cfe-commits
mailing list