[PATCH] D12945: [PATCH] Add checker for objects that should not be value types

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 26 17:53:57 PDT 2015


alexfh added a comment.

Please add a documentation file.


================
Comment at: clang-tidy/misc/NonCopyableObjects.cpp:21
@@ +20,3 @@
+  static const char *TypeNames[] = {
+    "::pthread_cond_t",
+    "::pthread_mutex_t",
----------------
How about making these lists configurable or adding a list for custom type names that should be checked in a similar way?

================
Comment at: clang-tidy/misc/NonCopyableObjects.cpp:81
@@ +80,3 @@
+  if (D && BD)
+    diag(D->getLocation(), "'%0' declared as type '%1'; did you mean '%1 *'?")
+        << D->getName() << BD->getName();
----------------
I think, error messages should contain some explanation of why is this wrong. Not sure if this can be fit into a reasonable number of words, but we have to try.


http://reviews.llvm.org/D12945





More information about the cfe-commits mailing list