[PATCH] D23427: [Clang-tidy] Comparison Misuse
Eugene Zelenko via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 11 14:33:11 PDT 2016
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.
Please mention this check in docs/ReleaseNotes.rst (in alphabetical order).
Please run Clang-format on newly added files. Test case is definitely needs it.
================
Comment at: clang-tidy/misc/ComparisonMisuseCheck.h:19
@@ +18,3 @@
+
+/// This checker reports errors related to the misuse of the comparison operator.
+/// It should warn for the following cases:
----------------
Check, please.
================
Comment at: clang-tidy/misc/ComparisonMisuseCheck.h:21
@@ +20,3 @@
+/// It should warn for the following cases:
+/// - strcmp,strncmp,memcmp misuse.
+/// - char* is compared to a string literal
----------------
Spaces after commas,
================
Comment at: docs/clang-tidy/checks/misc-comparison-misuse.rst:6
@@ +5,3 @@
+
+This checker reports errors related to the misuse of the comparison operator.
+It should warn for the following cases:
----------------
Check, please.
================
Comment at: docs/clang-tidy/checks/misc-comparison-misuse.rst:13
@@ +12,3 @@
+.. code-block::
+ bool isMyString(const char * my){
+ return "mystring"==my;//error. comparing pointer to string literal
----------------
Clang-format examples, please.
Repository:
rL LLVM
https://reviews.llvm.org/D23427
More information about the cfe-commits
mailing list