Closed
Description
The following code hits an assertion from diagnoseWellFormedUnsatisfiedConstraintExpr
:
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 clangd/clangd#1726 for analysis.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done
Milestone
Relationships
Development
No branches or pull requests
Activity
llvmbot commentedon Aug 16, 2023
@llvm/issue-subscribers-clang-frontend
zyn0217 commentedon Aug 16, 2023
This appears to be a duplicate of #64172, as my local patch would also resolve it.
zyn0217 commentedon Aug 16, 2023
Proposed fix: https://reviews.llvm.org/D158061
tru commentedon Aug 21, 2023
@AaronBallman is this something we should fix in 17.x? I see you added as a reviewer on the Phab diff.
llvmbot commentedon Aug 21, 2023
@llvm/issue-subscribers-c-20
AaronBallman commentedon Aug 21, 2023
We've been asserting on that code since Clang 10.0: https://clang.godbolt.org/z/Y6drTe37z so it's not a regression. I don't think we need to block 17.x on a fix for this (esp because @erichkeane is still out for a bit longer, so we won't hear from the concepts code owner before putting out the next rc).
11 remaining items