================
@@ -101,11 +101,14 @@ static const Loan *createLoan(FactManager &FactMgr, const
ValueDecl &VD,
/// Creates a loan for the storage location of a temporary object.
/// \param MTE The MaterializeTemporaryExpr that represents the temporary
-/// binding. \return The new Loan.
+/// binding.
+/// \param IssueExpr The expression the loan is reported at, if not \p MTE.
+/// \return The new Loan.
static const Loan *createLoan(FactManager &FactMgr,
- const MaterializeTemporaryExpr *MTE) {
- AccessPath Path(MTE);
- return FactMgr.getLoanMgr().createLoan(Path, MTE);
+ const MaterializeTemporaryExpr *MTE,
+ const Expr *IssueExpr = nullptr) {
+ return FactMgr.getLoanMgr().createLoan(AccessPath(MTE),
+ IssueExpr ? IssueExpr : MTE);
}
----------------
Xazax-hun wrote:
I pass `CXXDefaultArgExpr::getExpr()`'s result below which is not a MTE.
https://github.com/llvm/llvm-project/pull/239586
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits