[clang-tools-extra] r269229 - [Clang-tidy] modernize-use-bool-literals: documentation style.

Eugene Zelenko via cfe-commits cfe-commits at lists.llvm.org
Wed May 11 13:31:50 PDT 2016


Author: eugenezelenko
Date: Wed May 11 15:31:50 2016
New Revision: 269229

URL: http://llvm.org/viewvc/llvm-project?rev=269229&view=rev
Log:
[Clang-tidy] modernize-use-bool-literals: documentation style.

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

Modified:
    clang-tools-extra/trunk/docs/ReleaseNotes.rst
    clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-bool-literals.rst
    clang-tools-extra/trunk/test/clang-tidy/modernize-use-bool-literals.cpp

Modified: clang-tools-extra/trunk/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ReleaseNotes.rst?rev=269229&r1=269228&r2=269229&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/ReleaseNotes.rst (original)
+++ clang-tools-extra/trunk/docs/ReleaseNotes.rst Wed May 11 15:31:50 2016
@@ -199,7 +199,7 @@ identified.  The improvements since the
 - 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

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-bool-literals.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-bool-literals.rst?rev=269229&r1=269228&r2=269229&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-bool-literals.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-bool-literals.rst Wed May 11 15:31:50 2016
@@ -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++
 

Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-use-bool-literals.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-use-bool-literals.cpp?rev=269229&r1=269228&r2=269229&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/modernize-use-bool-literals.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-use-bool-literals.cpp Wed May 11 15:31:50 2016
@@ -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() {




More information about the cfe-commits mailing list