Find a solution to annotate forwarding functions like std::make_unique
Open
clang:temporal-safety
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```cpp
#include
#include
struct A {
std::string_view data;
A(const std::string& a [[clang::lifetimebound]]) : data(a) {}
std::string_view getData() { return data; }
};
std::unique_ptr bar() {
std::string on_stack = "I live on stack";
std::unique_ptr obj = std::make_unique(on_stack);
return obj; // return stack address of locak 'on_stack'
}
int main() {
std::unique_ptr obj = bar();
std::cout << obj->getData();
}
```
https://godbolt.org/z/ozo5q4Wx1
Contributor guide
Assessment
This issue has not been assessed yet.