<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64723>64723</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Crash with concepts in diagnoseWellFormedUnsatisfiedConstraintExpr
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend,
crash-on-invalid
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
zyn0217
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zyn0217
</td>
</tr>
</table>
<pre>
The following code hits an assertion from `diagnoseWellFormedUnsatisfiedConstraintExpr`:
```cpp
template <typename _Iterator> class normal_iterator {};
/// is_convertible
template <typename From, typename To> struct is_convertible {};
template <typename From, typename To>
inline constexpr bool is_convertible_v = is_convertible<From, To>::value;
template <typename From, typename To>
concept convertible_to = is_convertible_v<From, To>;
template <typename IteratorL, typename IteratorR>
requires requires(IteratorL __lhs, IteratorR __rhs) {
{ __lhs == __rhs } -> convertible_to<bool>;
}
constexpr bool operator==(normal_iterator<IteratorL> __lhs,
normal_iterator<IteratorR> __rhs) {
return __lhs.base() == __rhs.base();
}
template <typename T> struct Vector {
normal_iterator<T> begin() const { return {}; }
normal_iterator<T> end() const { return {}; }
};
class Object;
void function(Vector<Object *> objects) { objects.begin() == objects.end(); }
```
https://clang.godbolt.org/z/evchKETWq
See https://github.com/clangd/clangd/issues/1726 for analysis.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVU1v4zYQ_TX0ZWBDImNZPujg2DFQtECBbdo9ChQ1kljQpJakvJv99QX1FcX5KIIFBFsazrx5b4ZDcudkrREzsr0nlP580hGNd4RSsj2teOcbY7PRuCpM-ZQ9NgiVUcp8l7oGYUqERnoHXAN3Dq2XRkNlzQVIEpWS19o4_IpKnY29YPm3dtxLV0ksj0Y7b7nU_uFHa0kSEXYg0YlEh_DeP6JtB4vHS6u4RyDs6J9a1PyCkP_m0XJvLGEPIBR3DrSxF65yOS4A2d2T3Ymw-xF4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