[clang] [LifetimeSafety] Add support for `new`/`delete` (PR #192504)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 21 06:38:17 PDT 2026
================
@@ -239,7 +254,14 @@ class LifetimeChecker {
if (const auto *UF = CausingFact.dyn_cast<const UseFact *>()) {
if (Warning.InvalidatedByExpr) {
- if (IssueExpr)
+ if (isa<CXXDeleteExpr>(Warning.InvalidatedByExpr))
----------------
usx95 wrote:
I think `reportUseAfterInvalidation` can take care of this (using the text "free" in case of `DeleteExpr`).
https://github.com/llvm/llvm-project/pull/192504
More information about the cfe-commits
mailing list