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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 06:03:24 PDT 2015


aaron.ballman added inline comments.

================
Comment at: clang-tidy/misc/NonCopyableObjects.cpp:88
@@ +87,3 @@
+  else if (E)
+    diag(E->getExprLoc(), "expression has suspicious type '%0'")
+        << BD->getName();
----------------
alexfh wrote:
> What's a "suspicious type" and why should the user know about this? Should the message explain better what's wrong and what can be done about that?
I was trying to find better wording for this, but it's really hard. This comes from dereferencing a type that should only be used as an opaque pointer type. eg) memcpy(some_buffer, *some_pthread_mutex_t, sizeof(pthread_mutex_t));

Perhaps:

expression has opaque data structure type '%0'; do not rely on internal implementation details

or something to that effect?


http://reviews.llvm.org/D12945





More information about the cfe-commits mailing list