llvm-project
d4cf20ca - [Clang][Sema] Don't set instantiated from function when rewriting operator<=> (#91339)

Commit
1 year ago
[Clang][Sema] Don't set instantiated from function when rewriting operator<=> (#91339) The following snippet causes a crash: ``` template<typename T> struct A { bool operator<=>(const A&) const requires true = default; }; bool f(A<int> a) { return a != A<int>(); } ``` This occurs because during the rewrite from `operator<=>` to `operator==`, the "pattern" `operator<=>` function is set as the instantiated from function for the newly created `operator==` function. This is obviously incorrect, and this patch fixes it.
Author
Parents
Loading