================
Comment at: lib/Sema/SemaDeclAttr.cpp:655-656
@@ +654,4 @@
+  if (!isa<FunctionDecl>(D) && !isa<FunctionTemplateDecl>(D)) {
+    S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+      << Attr.getName() << ExpectedFunctionOrMethod;
+    return;
----------------
Dmitri Gribenko wrote:
> Can we promote this to an error?  There's no existing code that (mis)uses 
> this attribute, so there should be no compatibility concerns.
> 
> Please also add tests for this warning or error, and for 
> checkAttributeNumArgs() condition above.
I copy-pasted the code from the pre-existing code for no_thread_safety_analysis
and I did not fund such tests for that one. 
I guess we need tests for all 3 (+ no_address_safety_analysis). 
Where is the best place for them? Do you know similar existing tests? 

Yes, I guess we can make it an error. Will do the change tomorrow. 


http://llvm-reviews.chandlerc.com/D390
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to