[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 13 07:37:37 PDT 2017


JonasToth added inline comments.


================
Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:357
+  ConstExpr = Result.Nodes.getNodeAs<Expr>(CstId);
+  return ConstExpr && ConstExpr->isIntegerConstantExpr(Value, *Result.Context);
+}
----------------
xazax.hun wrote:
> I think you could just return the pointer and return a null pointer in case it is not an integerConstantExpr. This way no compatibility overload needed.
or `llvm::Optional` making it clear that no result is intended.


Repository:
  rL LLVM

https://reviews.llvm.org/D38688





More information about the cfe-commits mailing list