[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 14 13:26:10 PST 2024


================
@@ -249,7 +254,7 @@ static void visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path,
                                                   LocalVisitor Visit);
 
 template <typename T> static bool isRecordWithAttr(QualType Type) {
-  if (auto *RD = Type->getAsCXXRecordDecl())
+  if (auto *RD = Type.getNonReferenceType()->getAsCXXRecordDecl())
----------------
hokein wrote:

Can you explain why we we need this change? This function is used in multiple places of this file. Changing it can cause unexpected behavior change.  

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


More information about the cfe-commits mailing list