[Clang-tidy] modernize-use-bool-literals: documentation style.

Fix readability-redundant-control-flow warnings in regression test.

llvm-svn: 269229
This commit is contained in:
Eugene Zelenko 2016-05-11 20:31:50 +00:00
parent c1bfafd309
commit 1592d76d73
3 changed files with 2 additions and 6 deletions

View File

@ -199,7 +199,7 @@ identified. The improvements since the 3.8 release include:
- New `modernize-use-bool-literals
<http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html>`_ check
Finds integer literals which are cast to bool.
Finds integer literals which are cast to ``bool``.
- New `performance-faster-string-find
<http://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html>`_ check

View File

@ -3,7 +3,7 @@
modernize-use-bool-literals
===========================
Finds integer literals which are cast to bool.
Finds integer literals which are cast to ``bool``.
.. code-block:: c++

View File

@ -34,7 +34,6 @@ bool MacroIntToTrue = TRUE_MACRO;
#define FALSE_MACRO bool(0)
// CHECK-FIXES: {{^}}#define FALSE_MACRO bool(0){{$}}
bool TrueBool = true; // OK
bool FalseBool = bool(FALSE_MACRO);
@ -83,14 +82,12 @@ template<typename type>
void templateFunction(type) {
type TemplateType = 0;
// CHECK-FIXES: {{^ *}}type TemplateType = 0;{{$}}
return;
}
template<int c>
void valueDependentTemplateFunction() {
bool Boolean = c;
// CHECK-FIXES: {{^ *}}bool Boolean = c;{{$}}
return;
}
template<typename type>
@ -98,7 +95,6 @@ void anotherTemplateFunction(type) {
bool JustBool = 0;
// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: {{.*}}
// CHECK-FIXES: {{^ *}}bool JustBool = false;{{$}}
return;
}
int main() {