================
@@ -31,7 +31,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, 
LoanID ID) {
 struct AccessPath {
   const clang::ValueDecl *D;
 
-  AccessPath(const clang::ValueDecl *D) : D(D) {}
+  AccessPath(const clang::ValueDecl *D = nullptr) : D(D) {}
----------------
usx95 wrote:

> If the root of the access path is a `ParmVarDecl,` we know it was a 
> placeholder loan

This is different from borrowing the `ParmVarDecl`​ itself. A place holder loan 
is a loan held by the origin of ParmVarDecl and not a loan to the decl.  
Example in `int* foo(int* p) { int**x = &p; }`​, `&p`​ has a loan to `p`​ but 
`p`​ itself would contain the placeholder loan. Another thing is that these 
placeholder loans never expire(unlike other loans which expire when there 
access path gets destructed)

https://github.com/llvm/llvm-project/pull/169767
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to