<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/153594>153594</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[LifetimeSafety] Track loan expiry for ParmVarDecl
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:temporal-safety
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
usx95
</td>
</tr>
</table>
<pre>
```cpp
#include <string>
std::string* foo(std::string a) {
const std::string* p = &a;
return p;
}
```
https://godbolt.org/z/TM3G719a4
There is no expire fact generated for `a`.
Debug output:
```
[B2 (ENTRY)]
Succs (1): B1
[B1]
1: a
2: &[B1.1]
3: [B1.2] (ImplicitCastExpr, NoOp, const std::string *)
4: const std::string *p = &a;
5: p
6: [B1.5] (ImplicitCastExpr, LValueToRValue, const std::string *)
7: return [B1.6];
Preds (1): B2
Succs (1): B0
[B0 (EXIT)]
Preds (1): B1
==========================================
Lifetime Analysis Facts:
==========================================
Function: foo
Block B2:
End of Block
Block B1:
Issue (LoanID: 0, OriginID: 0)
Issue (LoanID: 1, OriginID: 0)
AssignOrigin (DestID: 1, SrcID: 0)
AssignOrigin (DestID: 2, SrcID: 1)
AssignOrigin (DestID: 3, SrcID: 2)
ReturnOfOrigin (OriginID: 3)
End of Block
Block B0:
End of Block
Compiler returned: 0
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzEVVFv4ygQ_jXjl1EjA8aJH_zg1PWpUm-7aqPV3SPBOOGWGAvwqr1ff8JOLmkvOe3bSpZBM983fMzAILzXu16pEvgaeJ2IMeytK0f_VvBka9v3EvJ0_uQwQFoBZbqXZmwVArv3wel-B-whetLKhxZYBaw62mmFnbVAV58cKIAWCMs1pBUiorS9D3iFPSCwGoHmAtgJ7FQYXY_DbIFlHf8nkbOOfQiDj7FoA7TZ2XZrTVhYtwPa_A202fzOfluSQmQzfLNXTqH22FtUb4N2CjshA-5Ur5wIqsXOOoQ8FZCni5lTq-24QzuGYQxxpU8a-HpNEejq4cvm5U-gBfB6lv86Sumjh0Qrq3BNoiMSyL8gEh1intM4B5pPiMUZwyb7ZKTAY5JWj4fBaKnDvfDh4W1wQO_xi30e4ng1xQi0ijKmgFkMeBN2pRI8EoZ5np_V8P9R8_RNmFFt7Ms0_pyuZQx9LPq8Qh6TcFLx1an2Y0LprUynp0ynU2n-eNxcVua_gchcamD1r_zmU4-IT7pTQR8UVr0w7157bIQM_nj6frXIZuxl0LaPmYuXPspeGyu_x4JMEhEf-hZtN5svAeQEQHz0flSxCk9W9I91jJbGc_Ls9E6fDdPZuIIlt7CIWE29bnZGVq18uGC9OvmRchtPP-DJzyzBPlDokfIyHevn7sy41M5OgW_lLb2R2Ht7GLRR7nhtVDtv66JHJW3J2oIVIlElWXJOVllOimRf5kIwzvKMyy7PslblKZfZaltwRvKiy1WiS5pSnq5IRjjJebHoiCxWmRR8pQiVbQZZqg5Cm4UxPw6x6SY61qkknPEiS4zYKuOn94ZSaUR8PqqgDoN1wtx50anwDjS2tMSVMcTddtx5yFKjffDnoEEHMz1bp2vxOlN5jRsn5Hc0VvRzO3-f-vdX4Q7fhKuVNMnoTPnpkdBhP24X0h6ANnGR43A3OPuXkgFoM23DA22OO_lR0n8CAAD__wH79TQ">