[clang] [Sema] Fix lifetime extension for temporaries in range-based for loops in C++23 (PR #145164)

Marco Vitale via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 22 02:53:44 PDT 2025


mrcvtl wrote:

A couple of quick notes:

- This is my first LLVM PR, so if there are any issues with code style or conventions, please let me know!
- I'm not entirely satisfied with the `VD->getName().starts_with("__range")` check, but it was the most reliable approach I found. Walking up the AST from the node didn’t seem feasible (likely due to optimizations?) and I noticed that pattern here: https://github.com/llvm/llvm-project/blob/075cb691a5e810f7114369c67b475dfd9127d4af/clang/lib/Sema/SemaStmt.cpp#L2481-L2485

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


More information about the cfe-commits mailing list