[PATCH] Add readability-simplify-boolean-expr check to clang-tidy

Richard legalize at xmission.com
Sun Feb 15 17:59:54 PST 2015


I looked at the `constexpr` case and while it could be done, it's quite a bit of work for what feels like an edge condition.

The primary intent of this check is to look for cases where we used boolean expressions in conjunction with boolean literals.  The extra literals are simply redundant.

However, with `constexpr` functions it isn't so cut-and-dried.  It seems that if you have a `constexpr` function that is hardcoded to always return `true` or `false`, that the better fixup would be to `Inline Function` on those `constexpr` functions.  At that point you could run this existing simplification and the usage would be detected and simplified.


http://reviews.llvm.org/D7648

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list