[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 28 08:01:16 PDT 2024


================
@@ -964,17 +966,34 @@ static bool pathOnlyInitializesGslPointer(IndirectLocalPath &Path) {
   return false;
 }
 
-void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
+void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity,
----------------
Xazax-hun wrote:

I am sort of wondering of we need a `variant` at all for this API. We always know statically whether we call with an InitializedEntity or an AssignedEntity. So I wonder if it would make more sense to have an overload set, both of which would call into something like `checkExprLifetimeImpl(LifetimeKind, AssignedEntity, InitializedEntity, InitializedEntity). 

https://github.com/llvm/llvm-project/pull/96475


More information about the cfe-commits mailing list