29 lines · plain
1.. title:: clang-tidy - modernize-use-bool-literals2 3modernize-use-bool-literals4===========================5 6Finds integer literals which are cast to ``bool``.7 8.. code-block:: c++9 10 bool p = 1;11 bool f = static_cast<bool>(1);12 std::ios_base::sync_with_stdio(0);13 bool x = p ? 1 : 0;14 15 // transforms to16 17 bool p = true;18 bool f = true;19 std::ios_base::sync_with_stdio(false);20 bool x = p ? true : false;21 22Options23-------24 25.. option:: IgnoreMacros26 27 If set to `true`, the check will not give warnings inside macros. Default28 is `true`.29