[PATCH] D84898: [clang-tidy] Add new checker for complex conditions with no meaning

Vince Bridgers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 30 02:32:46 PDT 2020


vabridgers added a comment.

Thanks all for the prompt and actionable comments. I will address all comments directly and 1-1, but would like to bottom out on one point before driving this forward. @lebedev.ri commented this should be in the Clang front end rather than a tidy check. Can we reach a consensus on that comment before I proceed with either a tidy check renamed to bugprone (comment from @Eugene.Zelenko ) or implement this check in the front end, enabled only when all warnings are enabled? I had considered both approaches when I started this, and thought the tidy checker was the best first step.

Also, @njames93, I take your point the expression does have a mathematical meaning. I was following the gcc warning message for the same expression, but we can cast the warning however we like :) Do you have a suggestion about the warning? I like the general idea of a suggestion to use parenthesis to remove the ambiguity.

Thanks! - Vince


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84898



More information about the cfe-commits mailing list