================ @@ -408,7 +405,8 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, // Once we initialized a value with a reference, it can no longer dangle. if (!Value) { for (const IndirectLocalPathEntry &PE : llvm::reverse(Path)) { - if (PE.Kind == IndirectLocalPathEntry::GslReferenceInit) + if (PE.Kind == IndirectLocalPathEntry::GslReferenceInit || ---------------- hokein wrote:
This code isn't used elsewhere, so I think it's fine to leave it as is (and I'm not sure it's a good idea to expose it as a function). I think this section could benefit from better documentation. Essentially, it bails out cases where we construct a GSL pointer from a reference, and before this change, the path could only contain GSL-specific IndirectLocalPathEntry. With this change, we should also consider the LifetimeBoundCall. There’s also some refactoring and enhancement in this part of the code in #104556, and I’ll add more documentation there. https://github.com/llvm/llvm-project/pull/105884 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits