Make it clearer how a loan ended up being used after it is destroyed
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
The idea for improvement is to highlight all the expressions/statements responsible for loan propagation of the expired loan to an origin which is used after the loan expires.
```cpp
#include
#include
#include
void foo() {
std::string_view f;
{
std::string str = "small scoped string";
std::string_view a, b, c, d, e;
a = str; // Ok. error: object whose reference is captured does not live long enough.
// TODO: add note: 'a' aliases 'str'
b = a;
c = a; // TODO: add note: 'c' aliases 'a'
d = c; // TODO: add note: 'd' aliases 'c'
e = d;
f = d; // TODO: add note: 'f' aliases 'd'
}
std::cout << f;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.