[clang] [LifetimeSafety] Catch intra-method lifetime_capture_by(this) dangles (PR #204630)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 1 07:37:53 PDT 2026


Xazax-hun wrote:

> For example, it doesn't go into NoescapeWarningsMap like other escape kinds, and it also seems to bypass some of the machinery those facts do go through.

Good catch, and indeed we do not diagnose `noescape` parameters escaping this way! Unfortunately, it is not that easy to diagnose them at the moment, the way the generated facts and loans are designed, we do not have a good source location to report the error. So I left this as follow-up work.

> One thing I got confused by is the naming

I agree the chosen name was poor. Renamed it to better reflect what is actually going on. 

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


More information about the cfe-commits mailing list