[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 6 12:23:24 PDT 2024


================
@@ -311,9 +311,9 @@ pushTemporaryCleanup(CodeGenFunction &CGF, const MaterializeTemporaryExpr *M,
         CleanupKind CleanupKind;
         if (Lifetime == Qualifiers::OCL_Strong) {
           const ValueDecl *VD = M->getExtendingDecl();
-          bool Precise =
-              VD && isa<VarDecl>(VD) && VD->hasAttr<ObjCPreciseLifetimeAttr>();
-          CleanupKind = CGF.getARCCleanupKind();
+          bool Precise = isa_and_nonnull<VarDecl>(VD) &&
----------------
efriedma-quic wrote:

Mixing together a bunch of cleanups with your actual changes makes things hard to read.

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


More information about the cfe-commits mailing list