Issue |
152519
|
Summary |
[LifetimeSafety] Add support for [[clang::lifetimebound]]
|
Labels |
clang:temporal-safety
|
Assignees |
|
Reporter |
usx95
|
Integrate `[[clang::lifetimebound]]`: This existing Clang annotation is crucial for specifying that the lifetime of a function's output is tied to one of its inputs.
```cpp
std::string_view Trim(std::string_view input [[clang::lifetimebound]]);
std::string_view foo() {
std::string a = "on stack";
std::string_view res = Trim(a);
return res; // warning: returning address of local variable 'a'.
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs