[PATCH] D73775: [clang-tidy] Cover cases like (b && c && b) in the redundant expression check

Alexey Romanov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 02:36:11 PST 2020


alexeyr marked 11 inline comments as done.
alexeyr added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp:363
+                      ASTContext &Context) {
+  const auto OpKind = getOp(TheExpr);
+  // if there are no nested operators of the same kind, it's handled by
----------------
alexeyr wrote:
> Eugene.Zelenko wrote:
> > Please don't use auto when type is not spelled explicitly or iterator.
> In this case the type will depend on `TExpr`: either `BinaryOperator::Opcode` or `OverloadedOperatorKind`. I could make it a template parameter (but it won't be deducible) or convert `OverloadedOperatorKind` to `Opcode`. Any preference?
Converted both to `OverloadedOperatorKind` (because I have a use for `OO_None`).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73775





More information about the cfe-commits mailing list