aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM aside from a minor nit.



================
Comment at: clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp:355
+           collectOperands<TExpr>(Operands.second, AllOperands, OpKind);
+  } else {
+    AllOperands.push_back(Part);
----------------
No `else` after a `return`.


================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/misc-redundant-expression.cpp:206
+
+  if (U && V && U && V) return true;
+  // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: overloaded operator has 
equivalent nested operands
----------------
I think that this is reasonable behavior, however, once the user overloads the 
operator there's no way to know whether calling that operator has other side 
effects that make this not actually be equivalent to `U && V`. That said, 
unless this happens an awful lot in practice, this still seems like a 
reasonable heuristic.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73775/new/

https://reviews.llvm.org/D73775



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

Reply via email to