[PATCH] D56303: [clang-tidy] Handle case/default statements when simplifying boolean expressions

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 5 14:25:57 PST 2019


riccibruno added inline comments.


================
Comment at: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:719
+    bool Negated, const SwitchCase *SwitchCase) {
+  assert(SwitchCase != nullptr);
+
----------------
LegalizeAdulthood wrote:
> aaron.ballman wrote:
> > Add a message to the assertion (same with the other ones).
> I'm not sure what you're asking for.  I based these asserts off the existing assert in the file.
Something like `assert((SwitchCase != nullptr) && "Some appropriate message blablabla!");`
Keep the parentheses around the operands of `!=` even if they are not strictly needed
since otherwise some bots will complain.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D56303





More information about the cfe-commits mailing list