[clang] Make [[clang::lifetimebound]] work for expressions coming from default arguments (PR #112047)
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 11 15:51:46 PDT 2024
================
@@ -532,6 +533,11 @@ static void visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path,
}
} while (Init != Old);
+ if (auto *DAE = dyn_cast<CXXDefaultArgExpr>(Init)) {
+ Path.push_back({IndirectLocalPathEntry::DefaultArg, DAE, DAE->getParam()});
+ Init = DAE->getExpr();
+ }
----------------
zygoloid wrote:
I think this should be in the loop above -- the default argument could itself contain one of the other expressions that we want to skip over.
https://github.com/llvm/llvm-project/pull/112047
More information about the cfe-commits
mailing list