[LifetimeSafety] Consider flowing origins through reinterpret_cast
Open
clang:temporal-safety
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```cpp
const int *bad(const int &x [[clang::lifetimebound]]) { // could not verify that the return value can be lifetime bound to 'x'
return (const int *)reinterpret_cast(&x); // clearly escapes
}
```
https://godbolt.org/z/nfqha7az6
Theoretically, we might need to tell the analyzer to assume it escapes regardless.
Contributor guide
Assessment
This issue has not been assessed yet.