<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63599>63599</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Inconsistent concept evaluation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Hyxogen
</td>
</tr>
</table>
<pre>
This code doesn't compile because of the static_assert when compiled with: `clang++ -std=c++20`
```c++
template <class T>
struct foo {
using type = T;
virtual void do_something(type t) = 0;
};
template <class T, class TypeT>
concept IsDoable = requires(T t, TypeT in) {
t.do_something(in);
};
static_assert(IsDoable<foo<int>, foo<int>::type>);
int main() {
}
```
It generates the following error:
```
<source>:14:1: error: static assertion failed
static_assert(IsDoable<foo<int>, foo<int>::type>);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:14:15: note: because 'IsDoable<foo<int>, foo<int>::type>' evaluated to false
static_assert(IsDoable<foo<int>, foo<int>::type>);
^
<source>:9:31: note: because 'in' would be invalid: parameter type 'foo<int>' is an abstract class
concept IsDoable = requires(T t, TypeT in) {
```
But if you insert `static_assert(IsDoable<foo<int>, int>);` above the other static_assert then it does compile.
```c++
template <class T>
struct foo {
using type = T;
virtual void do_something(type t) = 0;
};
template <class T, class TypeT>
concept IsDoable = requires(T t, TypeT in) {
t.do_something(in);
};
static_assert(IsDoable<foo<int>, int>);
static_assert(IsDoable<foo<int>, foo<int>::type>);
int main() {
}
```
I'm using clang version 15.0.7 from the Arch repository. I've also tested it with clang 16.0 on godbolt (https://godbolt.org/z/5G5Pq96c9) where the issue persists.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVk1v4zYQ_TX0ZRBBoqyvgw6OHbe59ZD7gpJGFguK1JIju-6hv70gJW9gI92iLYL20CCQSJPDeY_z-EThnDxpxJplzyw7bMRMg7H1j9dfzAn1pjHdtX4bpIPWdAid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