<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63972>63972</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang cannot determine constant expressions through the `requires`-clause
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hewillk
</td>
</tr>
</table>
<pre>
Not sure if this has been reported yet. Clang rejects the second `static_assert`:
```cpp
template<int N>
struct S {
constexpr auto size() { return N; }
};
template<int N>
void test(S<N> s) {
static_assert( (s.size() != 0) ); // ok
static_assert(requires { typename S< (s.size() != 0) >; }); // not ok
}
int main() {
test(S<3>{});
}
```
https://godbolt.org/z/sGqKWMPqY
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U0tvm0AQ_jXDZRRrvWteBw51HPdQNaqUQ9VTtcDEbINZsjMkTX59tWDnJaUSWmAGvsc8LLM7DEQVpFtId4mdpPOh6ujR9f1dUvv2qbr2gjwFQneL0jnGzjLWRAMGGn0QavGJZIWXvR0OGOgPNcIoHSFT44cWIVMsVlzz2zJTEMgUmC-gdqDOZ6aWqxnHJSJ0HHsrBObSDYLXYK6WBEuYGsEbhHy7RBAbP7DQ3zGgncQju2cCXYAu40cYSKYwRIgtQr47MeY7MNu3Gj5lfPCuRSEW0MUNmMuYQT6hnyW8N6gLBF3w6q0SvQazQ7U8l7MYvQe9R3_3GUig-8kF4tmGPI002CNh1PB_eHN19vqOaPDyQvZaiPmMjo_WDa9lO2l649tE3Hz7AvsR6NzD5bUTGTm2eeY--Lb2vax8OIDeP4Pe89f7bz-__7j_lbSVaUtT2oSqdVaUxUalKk-6yqbFOiu0NmXT1k2-oVtjrMrKJjVlSVQnrtJKG5VrpQpV6HyVarPOs7Shza2mWqWwUXS0rl_1_cMxcieOeaIqM2Wuk97W1PM8-VoP9IhzErSOixCq-M9FPR0YNqp3LPyKIk56qpZ5b-wQ69qSUDi6gZZhtINgHEhidn6I2xD8dOjmrYBMnRsLmbpoejsxJVPoqw81c9JN9arxR9D7yH26XYzBxx0DvZ8VM-j97OhfAAAA___1AB8J">