Martin =?utf-8?q?Bednár?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -90,3 +91,148 @@ void func(void) {
 // CHECK: CompoundAssignOperator=^= BinOp=^= 31
 // CHECK: CompoundAssignOperator=|= BinOp=|= 32
 // CHECK: BinaryOperator=, BinOp=, 33
+
+struct D {
+  D() = default;
+  D& operator+(){return *this;}
+  D& operator-(){return *this;}
+  D& operator*(const D&){return *this;}
+  D& operator/(const D&){return *this;}
+  D& operator%(const D&){return *this;}
+  D& operator+(const D&){return *this;}
+  D& operator-(const D&){return *this;}
+
+  D& operator<<(const D&){return *this;}
+  D& operator>>(const D&){return *this;}
+
+  bool operator<(const D&){return true;}
+  bool operator>(const D&){return true;}
+  bool operator<=(const D&){return true;}
+  bool operator>=(const D&){return true;}
+  bool operator==(const D&){return true;}
+  bool operator!=(const D&){return true;}
+
+  D& operator|(const D&){return *this;}
+  D& operator&(const D&){return *this;}
+  D& operator^(const D&){return *this;}
+
+  bool operator&&(const D&){return true;}
+  bool operator||(const D&){return true;}
+
+  D& operator+=(const D&){return *this;}
+  D& operator-=(const D&){return *this;}
+  D& operator*=(const D&){return *this;}
+  D& operator/=(const D&){return *this;}
+  D& operator%=(const D&){return *this;}
+  D& operator&=(const D&){return *this;}
+  D& operator|=(const D&){return *this;}
+  D& operator^=(const D&){return *this;}
+  D& operator<<=(const D&){return *this;}
+  D& operator>>=(const D&){return *this;}
+  D& operator,(const D&){return *this;}
+
+  int& operator->*(int D::*i){return this->i;}
+
+  // Negative test of --/++
+  D& operator++(){return *this;};
+  D& operator++(int){return *this;};
+  D& operator--(){return *this;};
+  D& operator--(int){return *this;};
+
+  int i;
+};
+
+void func2(void) {
+  #pragma clang diagnostic push
+  #pragma clang diagnostic ignored "-Wunused-value"
+  D a, b;
+  int D::*p = &D::i;
+
+  D *pc;
+  a->*p;
+
+  a *b;
+  a / b;
+  a % b;
+  a + b;
+  a - b;
+
+  a << b;
+  a >> b;
+
+  a < b;
+  a > b;
+
+  a <= b;
+  a >= b;
+  a == b;
+  a != b;
+
+  a &b;
+  a ^ b;
+  a | b;
+
+  a &&b;
+  a || b;
+
+  a = b;
+
+  a *= b;
+  a /= b;
+  a %= b;
+  a += b;
+  a -= b;
+
+  a <<= b;
+  a >>= b;
+
+  a &= b;
+  a ^= b;
+  a |= b;
+  a, b;
+
+// Negative test
+  a++;
+  ++a;
+  a--;
+  --a;
+  #pragma clang diagnostic pop
+}
+
+// CHECK: CallExpr=D:96:3 BinOp= 0
+// CHECK: CallExpr=D:96:3 BinOp= 0
----------------
Serafean wrote:

Twice, I'm not sure.
It's printed because I need to print `BinOp = 0`, as explained 
[here](https://github.com/llvm/llvm-project/pull/182303/changes#r2840730734).

https://github.com/llvm/llvm-project/pull/182303
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to