yronglin 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
Thanks for you fix! Maybe we can use `isInLifetimeExtendingContext()` instead of check the `__range` variable name. We usually get into an `LifetimeExtendingContex` in Sema. FYI, the initial PR is https://github.com/llvm/llvm-project/pull/76361. https://github.com/llvm/llvm-project/pull/145164 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits