[PATCH] D70469: [attributes] [analyzer] Add handle related attributes

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 11:51:37 PST 2019


xazax.hun marked an inline comment as done.
xazax.hun added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6524
+  if (auto *PVD = dyn_cast<ParmVarDecl>(D)) {
+    if (PVD->getType()->isIntegerType()) {
+      S.Diag(AL.getLoc(), diag::err_attribute_output_parameter)
----------------
aaron.ballman wrote:
> I'm skeptical of this. I think a better check is if the type is a pointer or reference -- was there a reason you didn't go with that approach?
The reason why I do not want to restrict this to pointers and references is that the users might have a custom wrapper type to deal with handles that might be passed by value. Or the user might pass an iterator by value which points to a handle.  These are not extremely likely, but I did not want to diagnose those cases. What do you think?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70469/new/

https://reviews.llvm.org/D70469





More information about the cfe-commits mailing list