EricWF marked 4 inline comments as done.
EricWF added inline comments.

================
Comment at: include/clang/AST/Expr.h:3097-3106
+  bool isRelationalOp() const {
+    return isRelationalOp(getOpcode()) ||
+           (getOpcode() == BO_Cmp && IsCmpOrdered);
+  }
 
   static bool isEqualityOp(Opcode Opc) { return Opc == BO_EQ || Opc == BO_NE; }
+  bool isEqualityOp() const {
----------------
rsmith wrote:
> These seem wrong to me. Relational operators are `<`, `<=`, `>`, and `>=`. 
> `<=>` is not a relational operator even if it's an ordered comparison. 
> Likewise, `<=>` is not an equality operator even if we don't have an ordered 
> comparison.
> 
> If you undo this, you can also drop the `IsCmpOrdered` member entirely.
OK. I'll find another way to do this.

The intention was to facilitate identification of three-way comparisons which 
require equality/relational comparisons, which may or may not be legal in 
certain contexts. For example, comparing member pointers of different bases is 
OK, but only so long as we're evaluating them for strong/weak equality. 


https://reviews.llvm.org/D45476



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to