[PATCH] [clang-tidy] Add a checker for implicit bool conversion of a bool*.

Alexander Kornienko alexfh at google.com
Thu Jul 10 03:46:24 PDT 2014


Thank you for working on this!

================
Comment at: test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp:7
@@ +6,3 @@
+
+void foo() {
+  bool *b = SomeFunction();
----------------
Please add tests with macros and templates.

================
Comment at: test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp:15
@@ +14,3 @@
+  if (!b) {
+    // no-warning
+  }
----------------
Daniel Jasper wrote:
> Don't you need at least one more CHECK-MESSAGES-NOT: warning to verify that there aren't any further warnings?
I'm also working on a patch for FileCheck to add an option to add implicit CHECK-NOT with certain pattern around each CHECK. It is rather trivial to do, I'm just stuck with the naming. Current version is -explicit-matches=<pattern>

http://reviews.llvm.org/D4458






More information about the cfe-commits mailing list