<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/96278>96278</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang(trunk) fails to compile std::replace_if
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mrdaybird
</td>
</tr>
</table>
<pre>
CE: https://godbolt.org/z/e9T7MYeE5
Program:
```
#include <algorithm>
#include <vector>
#include <cstdint>
void replace_if_epi8(std::vector<int8_t>& v) {
std::replace_if(v.begin(), v.end(), [](int8_t x){return x == 13 || x == -12; }, 42);
}
void replace_if_epi32(std::vector<int32_t>& v) {
std::replace_if(v.begin(), v.end(), [](int8_t x){return x == 13 || x == -12; }, 42);
}
```
Output:
```
In file included from <source>:1:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/algorithm:60:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/stl_algobase.h:64:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/stl_pair.h:60:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/type_traits:549:30: error: use of class template '__is_pointer' requires template arguments; argument deduction not allowed in function return type
549 | : public __bool_constant<__is_pointer(_Tp)>
| ^~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/cpp_type_traits.h:366:12: note: template is declared here
366 | struct __is_pointer : __truth_type<_IsPtr>
| ^
1 error generated.
```
Note: This was not a issue a few weeks ago on trunk.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVj1z4z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