Skip to content
Commit 6ae400d1 authored by Alexander Kornienko's avatar Alexander Kornienko
Browse files

[clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr...

Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return
true; return false;' and improve replacement expressions.

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.) By default, chained conditional assignment is
left unchanged, unless a configuration parameter is set to non-zero to override
this behavior.

It also improves the handling of replacement expressions to apply
static_cast<bool>(expr) when expr is not of type bool.

http://reviews.llvm.org/D9810

Patch by Richard Thomson!

llvm-svn: 241155
parent def554db
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment