NoQ added inline comments.

================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:7287
+  case ParsedAttr::AT_AcquireHandle:
+    handleSimpleAttribute<AcquireHandleAttr>(S, D, AL);
+    break;
----------------
xazax.hun wrote:
> NoQ wrote:
> > The next obvious step here would be to type-check the declaration to make 
> > sure that it's actually a handle (and emit a warning if it isn't).
> Yeah, I do agree, but I think this depends on the role of the attribute. 
> Adding a type check would make this more restrictive in a sense other users 
> who want to write for example a Posix API checker and want to reuse this 
> attribute might not be able to do so without touching the type-check code. 
> Which may or may not be good. I do not have any strong feelings about either 
> of the directions. 
So you envision this working on completely arbitrary types? Fair!

Maybe check that when `AcquireHandleAttr` is on a parameter, it's actually an 
out-parameter?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70469



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to