[clang] [LifetimeSafety] Replace `PointerUnion` in `AccessPath` (PR #193520)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 08:37:24 PDT 2026


https://github.com/NeKon69 created https://github.com/llvm/llvm-project/pull/193520

Basically, the problem with the current approach is that `PointerUnion` on 32-bit systems does not have enough low bits available to store the tag data after #192504. So we either need to replace `PointerUnion` with something else, or figure out a way around this restriction. Another way to fix this would be to not store `CXXNewExpr` there at all.
I would like to discuss this before making any changes.

cc: @usx95 @Xazax-hun

>From 970e6afa6a2ac751092593d32a719c92b406b93d Mon Sep 17 00:00:00 2001
From: NeKon69 <nobodqwe at gmail.com>
Date: Wed, 22 Apr 2026 18:30:52 +0300
Subject: [PATCH] placeholder commit

---
 clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
index aee6bf9eb69c9..3f1445540c730 100644
--- a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h
@@ -52,8 +52,8 @@ class AccessPath {
 
 private:
   Kind K;
-  const llvm::PointerUnion<const clang::ValueDecl *,
-                           const clang::MaterializeTemporaryExpr *,
+  const llvm::PointerUnion<const clang::MaterializeTemporaryExpr *,
+                           const CXXNewExpr *, const clang::ValueDecl *,
                            const ParmVarDecl *, const CXXMethodDecl *>
       Root;
 



More information about the cfe-commits mailing list