<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/104496>104496</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] Invalid copy-construction from span<Incomplete>
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
ldionne
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ldionne
</td>
</tr>
</table>
<pre>
The following code fails on libc++ but works with other implementations:
```
#include <span>
struct Bar;
void foo(std::span<Bar> a) {
std::span<Bar> b(a);
}
```
The problem seems to be that we try testing for the range-based constructor of span, which hard-errors because we are checking the `contiguous_range` constraint and end up performing arithmetic on a pointer to an incomplete type.
Repro: https://godbolt.org/z/ox6dajefE
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U8GOqzgQ_BpzaSUiBhI4cJhMEmmuq72vjN0Ezxg3sptks1-_MsPMRE_vScgI6Kru6ipUjPbqEVtRHYWUzljyHoWUojplauaBQru-zDoyj_bvAaEn5-hu_RU0GYReWReBPDjbaSGPQh6hmxnuFD4i3C0PQDxgADtODkf0rNiSj6J4EflJ5F_nPl-vz0dZWK_dbBBE8Ron5UVxfq6PHGbNcFRBFMfnDzeyBnoiIevIJnUpXj7xr0vxGZSQDYjDigL4Q1knZJ1Kf_gPp9_PupxpNVOgzuEIEXGMwAQdAg-K4Y7A4QGMkdPiegrAA0JQ_oqbTkU0oMl_aqIA1MMyi3yF-2D1AIMKZoMhUIjQoVZzxMSpAoIeUH8k0kQo9rkmz_Y60xz_WejFPl-5lfUMyhtAb2CeYMLQUxgTVgXLw4hsdXJSwUTWM4YkQXmwXlMyjxH4MeH2WfZfOAUSxQsMzNNiqrwIebmS6cjxlsJVyMt_Ql7o371R79ifM9MWpikalWG7O8jiUMm6abKh7Zu-kabKtTF903RN3u9lve_rZlfpoq66zLYyl2Ve7yqZ78qq2UosGl0orEpVV6XKRZnjqKzbOncbU-_Mxjhju8vLstlnTnXo4lfYv-O65j20CbXp5msUZe5s5PjDw5bd8ps8waoTvPmbcjaZNz023w5a8tAHGmEN1Nv3_kRxzubg2l-WZXmYu62mUchLarneNlOgd9Qs5GXREYW8rFJurfw_AAD__znHLeM">