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

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 5 15:56:52 PST 2019


LegalizeAdulthood marked 3 inline comments as done.
LegalizeAdulthood added inline comments.


================
Comment at: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:719
+    bool Negated, const SwitchCase *SwitchCase) {
+  assert(SwitchCase != nullptr);
+
----------------
riccibruno wrote:
> 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.
OK, I can do that; I wasn't sure if it was being suggested that I use some custom assert macro that took the message as a parameter.


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

https://reviews.llvm.org/D56303





More information about the cfe-commits mailing list