| Issue |
176399
|
| Summary |
[LifetimeSafety] False-negative for references initialised through dangling temporaries
|
| Labels |
clang:temporal-safety
|
| Assignees |
|
| Reporter |
usx95
|
```cpp
#include <iostream>
#include <string>
#include <string_view>
struct S {
S();
~S();
const std::string& x() const [[clang::lifetimebound]];
};
void G() {
const std::string& x = S().x(); // Not detected!
(void)x;
}
```
https://godbolt.org/z/f6KMh5ndo
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs