<div dir="ltr">Well, if there's no current attribute that will trigger these new messages, I suppose testing can wait.<div><br></div><div><br></div><div>As an aside, our diagnostic tablegen system could really use a mechanism to define these enumerated lists. I'd love to be able to write something like</div>
<div><br></div><div>def AttrRecipient : Select<"attr_recipient",</div><div> [SelectVal<"VarFunctionAndLabel", "varaibles, functions, and labels">,</div><div> SelectVal<"FieldsAndGlobals", "fields and global variables">,</div>
<div> // ...</div><div> ]</div><div>>;</div><div>def err_foo : Error<"%0 attribute only aplpies to %select<attr_recipient>1">;<br></div><div><br></div><div>... where this would generate both the diagnostic with a proper %select and also an enumerated type for the attribute argument.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 19, 2013 at 5:29 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Perhaps unit testable, but I'm not certain. If you have suggestions,<br>
I'm all ears.<br>
<br>
I wish there was a way to consolidate these two into a single<br>
diagnostic though, that's for sure. There are a couple of other<br>
diagnostics that are similar in nature....<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, Nov 19, 2013 at 8:27 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> Is this testable?<br>
><br>
><br>
> On Tue, Nov 19, 2013 at 5:14 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>><br>
> wrote:<br>
>><br>
>> Author: aaronballman<br>
>> Date: Tue Nov 19 19:14:35 2013<br>
>> New Revision: 195186<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=195186&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=195186&view=rev</a><br>
>> Log:<br>
>> Ensuring the warning for attribute decl types matches the error for<br>
>> attribute decl types.<br>
>><br>
>> Modified:<br>
>> cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
>><br>
>> Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=195186&r1=195185&r2=195186&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=195186&r1=195185&r2=195186&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br>
>> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Nov 19<br>
>> 19:14:35 2013<br>
>> @@ -2040,7 +2040,8 @@ def warn_attribute_wrong_decl_type : War<br>
>> "variables, functions and labels|fields and global variables|structs|"<br>
>> "variables, functions and tag types|thread-local variables|"<br>
>> "variables and fields|variables, data members and tag types|"<br>
>> - "types and namespaces|Objective-C interfaces}1">,<br>
>> + "types and namespaces|Objective-C interfaces|methods and properties|"<br>
>> + "struct or union|struct, union or class}1">,<br>
>> InGroup<IgnoredAttributes>;<br>
>> def err_attribute_wrong_decl_type : Error<<br>
>> "%0 attribute only applies to %select{functions|unions|"<br>
>> @@ -2050,8 +2051,8 @@ def err_attribute_wrong_decl_type : Erro<br>
>> "variables, functions and labels|fields and global variables|structs|"<br>
>> "variables, functions and tag types|thread-local variables|"<br>
>> "variables and fields|variables, data members and tag types|"<br>
>> - "types and namespaces|Objective-C interfaces|"<br>
>> - "methods and properties|struct or union|struct, union or class}1">;<br>
>> + "types and namespaces|Objective-C interfaces|methods and properties|"<br>
>> + "struct or union|struct, union or class}1">;<br>
>> def warn_type_attribute_wrong_type : Warning<<br>
>> "'%0' only applies to %select{function|pointer|"<br>
>> "Objective-C object or block pointer}1 types; type here is %2">,<br>
>><br>
>><br>
>> _______________________________________________<br>
>> cfe-commits mailing list<br>
>> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>