[PATCH] D45680: [C++2a] Add operator<=> Rewriting - Early Attempt
Eric Fiselier via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 16 18:47:16 PDT 2018
EricWF marked an inline comment as done.
EricWF added inline comments.
================
Comment at: lib/Sema/SemaOverload.cpp:9218-9219
+ // --- F2 is a rewritten candidate ([over.match.oper]) and F1 is not.
+ if (Cand2.getRewrittenKind() && !Cand1.getRewrittenKind())
+ return true;
+ if (Cand1.getRewrittenKind() && Cand2.getRewrittenKind() &&
----------------
rsmith wrote:
> You also need to check the reverse condition and return false (the "or if not that" is ... somehow ... supposed to imply that).
Hmm. So I'm wondering what is intended by the language `F1 and F2 are rewritten candidates, and F2 is a synthesized candidate with reversed order of parameters and F1 is not`. For example, what happens when comparing two distinct member functions with only one explicit parameter?
```
struct T;
struct U { auto operator<=>(T); };
struct T { auto operator<=>(U); };
auto r = T{} < U{}; // Are the synthesized and rewritten overloads ambiguous?
```
Repository:
rC Clang
https://reviews.llvm.org/D45680
More information about the cfe-commits
mailing list