<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/116066>116066</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] False diagnositc for container for pointer with lifetimebound
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
usx95
</td>
</tr>
</table>
<pre>
```cpp
#include <optional>
#include <string>
#include <string_view>
template <class T>
struct S {
T foo(T&& t [[clang::lifetimebound]]);
};
void use() {
S<std::string_view> s;
std::string_view x = s.foo(std::optional<std::string_view>{}.value()); // False warning here.
}
```
cc: @hokein @Xazax-hun
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8Ustu2zAQ_JrVZRGBDz2igw5OVf9AcuitoEhaYkuTAh9O2q8vJDl2A6QFCGopDmdndlfEaCandQ_1E9RDIXKafehzfOvqYvTqVw8N2ZdcFiADkAMwbpy0WWkE_sUvyXgnLPCvn13HFIyb_nv5_WL06x2x7UmfFyvShpJWxIgvN0RMIcuEzwjt0_4HEfEFT94De3wB1gBrMOFm6UlaseY_AD9Yc9LJnPXos1NQD-tiHfArC7TDPd72izcKc9TAHoF1f-V73sSrnfajC4w3klXWZyh8Q-ADxnJXfIPcS_kv8lVBO5QXYfNV1G4AgR2BHfEobNT4KoIzbsJZB13eve3Bezv3o5TADwgVmf1PbdwafRO_xdvDnB0Wqueq450odE9bTmtK66ot5v7UEiWrTqiWSipV3TDONFFtx0fOGSGF6RlhFaWU05rVVVV2laBENpXkXFbjSUBF9FkYW1p7OZc-TIWJMeue0oY0TWHFqG3chpKx9w4qIybnYzIyAmPrtIZ-ff4w5ilCRayJKd4Jk0l2m-v9fT1cq3OlMUniyQeU3iVhnA7bafHGJR3w1aQZP8xLkYPt55SWuDZmK_dk0pzHUvozsOOa9_p5WIL_oWUCdtxcRWDHq7FLz_4EAAD__3EpBtc">