if (cand->rewritten ())
{
/* FIXME build_min_non_dep_op_overload can't handle rewrites. */
- if (overload)
+ if (code == NE_EXPR && !cand->reversed ())
+ /* It can handle != rewritten to == though. */;
+ else if (overload)
*overload = NULL_TREE;
switch (code)
{
int nargs, expected_nargs;
tree fn, call, obj = NULL_TREE;
+ bool negated = (TREE_CODE (non_dep) == TRUTH_NOT_EXPR);
non_dep = extract_call_expr (non_dep);
nargs = call_expr_nargs (non_dep);
CALL_EXPR_ORDERED_ARGS (call_expr) = CALL_EXPR_ORDERED_ARGS (non_dep);
CALL_EXPR_REVERSE_ARGS (call_expr) = CALL_EXPR_REVERSE_ARGS (non_dep);
+ if (negated)
+ call = build_min (TRUTH_NOT_EXPR, boolean_type_node, call);
if (obj)
return keep_unused_object_arg (call, obj, overload);
return call;
template<class T>
void f() {
A a;
- (void)(a != 0, 0 != a); // { dg-bogus "deleted" "" { xfail *-*-* } }
+ (void)(a != 0); // We only handle this simple case, after PR121179
+ (void)(0 != a); // { dg-bogus "deleted" "" { xfail *-*-* } }
(void)(a < 0, 0 < a); // { dg-bogus "deleted" "" { xfail *-*-* } }
(void)(a <= 0, 0 <= a); // { dg-bogus "deleted" "" { xfail *-*-* } }
(void)(a > 0, 0 > a); // { dg-bogus "deleted" "" { xfail *-*-* } }
bool operator>(A, int) = delete;
bool operator>=(A, int) = delete;
+bool operator!=(int, A) = delete;
+bool operator<(int, A) = delete;
+bool operator<=(int, A) = delete;
+bool operator>(int, A) = delete;
+bool operator>=(int, A) = delete;
+
template void f<int>();