summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2016-02-08 14:37:56 +0000
committerAaron Ballman <aaron@aaronballman.com>2016-02-08 14:37:56 +0000
commit54391c8ca64570220798d224323c6d1427e1c86c (patch)
tree23004b1542f6f415044c0074fff74d444a81cba4 /clang-tools-extra/docs/clang-tidy
parentf4490cab0d52ed9323ead7871baf0bbb89d662c6 (diff)
downloadbcm5719-llvm-54391c8ca64570220798d224323c6d1427e1c86c.tar.gz
bcm5719-llvm-54391c8ca64570220798d224323c6d1427e1c86c.zip
Reverting r260096; it causes build bot failures:
http://bb.pgr.jp/builders/cmake-clang-tools-x86_64-linux/builds/23351 http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/492 llvm-svn: 260097
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst
index c3c111961fb..4c3a1c8f8ce 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst
@@ -35,14 +35,11 @@ The resulting expression ``e`` is modified as follows:
2. Negated applications of ``!`` are eliminated.
3. Negated applications of comparison operators are changed to use the
opposite condition.
- 4. Implicit conversions of pointers, including pointers to members, to
- ``bool`` are replaced with explicit comparisons to ``nullptr`` in C++11
- or ``NULL`` in C++98/03.
+ 4. Implicit conversions of pointer to ``bool`` are replaced with explicit
+ comparisons to ``nullptr``.
5. Implicit casts to ``bool`` are replaced with explicit casts to ``bool``.
6. Object expressions with ``explicit operator bool`` conversion operators
are replaced with explicit casts to ``bool``.
- 7. Implicit conversions of integral types to ``bool`` are replaced with
- explicit comparisons to ``0``.
Examples:
1. The ternary assignment ``bool b = (i < 0) ? true : false;`` has redundant
@@ -63,11 +60,11 @@ Examples:
The ternary assignment ``bool b = (i & 1) ? true : false;`` has an
implicit conversion of ``i & 1`` to ``bool`` and becomes
- ``bool b = (i & 1) != 0;``.
+ ``bool b = static_cast<bool>(i & 1);``.
5. The conditional return ``if (i & 1) return true; else return false;`` has
an implicit conversion of an integer quantity ``i & 1`` to ``bool`` and
- becomes ``return (i & 1) != 0;``
+ becomes ``return static_cast<bool>(i & 1);``
6. Given ``struct X { explicit operator bool(); };``, and an instance ``x`` of
``struct X``, the conditional return ``if (x) return true; return false;``
OpenPOWER on IntegriCloud