<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/100567>100567</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Missing dangling warnings for normal local array returned as std::span
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend,
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hokein
</td>
</tr>
</table>
<pre>
See the example: https://godbolt.org/z/nnjKszT4c
I think the reason is that we don't know the type `abc2` is gsl-owner.
```
#include <span>
#include <vector>
using namespace std;
span<const int> func1() {
int abc2[10];
return abc2; // bad, no dangling warning
}
span<const int> func2() {
std::vector<int> abc;
return abc; // good, danging warning.
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMk8tu2zwQhZ9mtBnEoIaSZS208CUGfvzoqn0B3iwxoUmDpOImT19IVmoj7aKAQEE4B4ffXCRSsr03poN6B_WhEGMeQuyG8GqsL2TQ7913YzAPBs1Pcb44A3yLQ86XBHwLdAQ69kHL4PIqxB7o-AF09P7l__Txo1LADsC2t_M_zIP1r3NWNCIFjzZhHkTGq0EdPFCT8dWH62zJ7xeDsGZCKoI1m7x9ck_h6k1c4WMwrNny3D6JW6_cqA0C36eL8MCf_ya9GZVDvIvzOSbre_TibNJFKIMpa-C7R8ctca-CTxmtz8Cf8TR6VQJtgFqEZrHjpOLMX-9KBvXhdxJiNHmM_qbyHd46iVJooD36gFr43k0oVxG99f1C0Bz-BYX-RJnr2ALffla9X_xCqjvWneoBqg9hppqQHohWX5E-x1DojuuWt6IwXdlQ2ZbVhrNi6EiJk67qipesPhmuq1KqdbWRbds0reBNYTtiVLGG6pJXjNrVRilq1opVUtJaCgkVM2dh3cq5t_O0cIVNaTRdyVi9bgonpHFp3mUi5YTvgW9PMfhsvAYioP2DoK3ofUjZqjRp9aGI3ZT7JMc-QcWcTTndb8o2O9N9s2nekK_zSXgKEX2IZ-HQBSUcihjF-9JSo1Gk-xCmwRVjdN2XP8nmYZQrFc5Ax-ni5fV0ieHFqAx0nOtNQMel5LeOfgUAAP__9JQjBA">