[clang] [LifetimeSafety] Suggest lifetime annotations (PR #169767)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 27 22:15:13 PST 2025
================
@@ -31,7 +31,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, LoanID ID) {
struct AccessPath {
const clang::ValueDecl *D;
- AccessPath(const clang::ValueDecl *D) : D(D) {}
+ AccessPath(const clang::ValueDecl *D = nullptr) : D(D) {}
----------------
usx95 wrote:
Makes sense to have a flag.
> Could there still be cases where they are invalidated? E.g. in the earlier example (even if we do not detect this for now).
Oh yeah. SG. These could be invalidated by calling invalidating functions. In this case, we can also suggest clang::invalidates or similar for `v` in the future.
https://github.com/llvm/llvm-project/pull/169767
More information about the cfe-commits
mailing list