<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62886>62886</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang does not accept consteval operators
</td>
</tr>
<tr>
<th>Labels</th>
<td>
c++20,
clang:frontend,
rejects-valid,
consteval
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
usx95
</td>
</tr>
</table>
<pre>
GCC: `g++.dg/cpp2a/consteval31.C`
```cpp
struct A {
consteval A operator+() { return {}; }
};
consteval A operator~(A) { return {}; }
consteval A operator+(A, A) { return {}; }
template <class> void f() {
A a;
A b = ~a; // cannot take address of consteval function 'operator~' outside of an immediate invocation
A c = a + a; // similar error
A d = +a; // similar error
}
template void f<int>();
```
https://godbolt.org/z/MxncM3Yaq
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU82O2zgMfhr6QkzgUP49-OA4kz3NA-xRlpREu4rkleRgtod59kL21AmKFlPAMEWa5Ed-_sRD0BerVAflAcpjxud4db6bw3tbZqOT_3d_DQOwHqHKL0AHoMNOXoBOYpqIJ-tsiOrODdvvBqhyyI-Q9-mwPGKa1kiIfhYRe4T6sEYQEbdq7NFNyvPo_ILSALUpFb2Ks7dLVX0EdsBkVozFX8-_6vMB1PRft_n9CD3QgH_QYX1HdZsMjwqBDcLwEIC94t1piefHOo_Ne-Tb9Ks_IrAjfvClN52ATii4tS5i5P8q5FJ6FQK68xNr59mKqJ1FoPpp7xrdHIOWKmVzi_p2U1Kn4bS9O8FTyTO0WKA5Ah3wGT_omzbco_Le-ecCuRQAHb7I3jja2PlkhA3aRmCvKzUbE5tuVvca4xSA9SvAxcnRmbhzPgnwG9Dp7d2KN_Y3_y-THZMta3mmun3VFE1RFVWRXTtW5y2Jiqq9GmVbFuLc5ly2oinHvJY5ZbqjnFheEttTWVCxq5qCN3XD8ro4q7IhKHJ149rsjLnfEnamQ5hVV1HTVJnhozJhuT1EYr0glAMR0JAihtsLsP7snY3Kyu2DV_8oEcPLnRv9iG4_NkXKY-a7BPoyzpcARW50iOExRtTRqG5ICCidCpikwoVQU3xSyA9VhGz2pvuJUB2v87gT7gZ0Sn0_zcvkXRoP6LTsGoBOy7rfAwAA__9Wbzi7">