aaron.ballman added inline comments.

================
Comment at: clang/lib/Sema/SemaType.cpp:7424
+                             ParsedAttr &Attr) {
+  if (CurType->isFunctionType()) {
+    State.getSema().Diag(Attr.getLoc(), diag::warn_type_attribute_wrong_type)
----------------
Is this correct, or should it be `if (!CurType->isFunctionType())`?


================
Comment at: clang/test/Sema/attr-handles.cpp:20-21
+void ht(int __attribute__((acquire_handle(1))) *a); // expected-error 
{{'acquire_handle' attribute takes no arguments}}
+int it() __attribute__((release_handle)); // expected-warning 
{{'release_handle' only applies to non-function types; type here is 'int ()'}}
+int jt() __attribute__((use_handle)); // expected-warning {{'use_handle' only 
applies to non-function types; type here is 'int ()'}}
+int __attribute__((acquire_handle)) at; // expected-warning {{'acquire_handle' 
attribute only applies to functions, function pointers, and parameters}}
----------------
These diagnostics look incorrect to me -- I thought we wanted the attribute to 
apply to function types?

You should also add some test cases where the attribute is applied to a 
function pointer type.


================
Comment at: clang/test/Sema/attr-handles.cpp:23
+int __attribute__((acquire_handle)) at; // expected-warning {{'acquire_handle' 
attribute only applies to functions, function pointers, and parameters}}
\ No newline at end of file

----------------
Please add the newline to the end of the file.


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