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m22Akp1jnvtu2mLLO7nNHvzCrhrJzvFr4aIeuhC9g0OqCx3DbRWXUH948pg2HU0XD1cnKDUVN_mtveP3e9SIZliJ_0scWYRDVm8DfymBjh>53412</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Shouldn't support `*p` for void pointers, at least in SFINAE contexts
</td>
</tr>
<tr>
<th>Labels</th>
<td>
c++,
c++20,
clang:frontend,
rejects-valid
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Quuxplusone
</td>
</tr>
</table>
<pre>
Clang trunk (soon to be 14) rejects this valid C++ program:
```
template<class T> auto f(int, T *p) -> decltype(*p);
template<class T> constexpr int f(long, T *p) { return 1; }
static_assert(f<void>(0, nullptr) == 1);
int main() {}
```
The problem is that Clang supports `*p` for void pointers, as an extension; but that extension isn't disabled in SFINAE contexts. It prints a warning (actually it prints the same warning twice):
```
warning: ISO C++ does not allow indirection on operand of type 'void *' [-Wvoid-ptr-dereference]
auto f(int, T *p) -> decltype(*p);
^~
```
but that's not good enough. Clang needs to actually SFINAE away the `decltype(*p)` return type so that the other overload can be chosen.
This is reduced from the definition of `std::ranges::iter_move` in C++20. `std::ranges::iter_move` is supposed to be invocable for any `E` where `*E` is well-formed, so it is invocable for `void*` on Clang but not GCC.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVE1v4zYQ_TXyZWBDoiI7OejgOE6RS4siAXpc0OJI5i5NCiRlx_--j5LWuymCbVGDtsUPvXnz5g0PTl3rnZG2o-gH-40ycR-csxQdHZiKu0w8kOev3MRA8agDnaXRinaZeMSg3rvOy1NWbrP8Kcu32TqfxziNfOqNjJyVu8bIEOgtK_ckB6C3iKRtzMSO3hB126dIy7StuDHx2jMOzOtZ-fgrvMbZEPm99wTAEdg4231EzjaPyCMO3lIBOMyfJsgQZdTNF4CxB5v7FthnpxWAMcsTih2M6aMfYconDED8RCoFPUltR75jpBv4P-SYft-OnHQ7GD6RT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