[PATCH] Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return true; return false; '

Richard legalize at xmission.com
Sat May 16 22:10:47 PDT 2015


Hi alexfh,

This changeset extends the simplify boolean expression check in `clang-tidy` to simplify `if (e) return true; return false;` to `return e;` (note the lack of an else clause on the if statement.)

http://reviews.llvm.org/D9810

Files:
  clang-tidy/readability/SimplifyBooleanExprCheck.cpp
  clang-tidy/readability/SimplifyBooleanExprCheck.h
  test/clang-tidy/readability-simplify-bool-expr.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9810.25923.patch
Type: text/x-patch
Size: 9597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150517/92a58ae1/attachment.bin>


More information about the cfe-commits mailing list