r195186 - Ensuring the warning for attribute decl types matches the error for attribute decl types.

Aaron Ballman aaron at aaronballman.com
Tue Nov 19 18:10:15 PST 2013


On Tue, Nov 19, 2013 at 9:03 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> Well, if there's no current attribute that will trigger these new messages,
> I suppose testing can wait.

Ah, no, there are no attributes that require these. This was fixing up
a bug introduced by Fariborz's recent ObjC attribute changes. He added
some new error enumerants, but forgot to add the warning variants. I
was merely keeping the two in sync so the enumerations would remain
valid.

> 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
>
> def AttrRecipient : Select<"attr_recipient",
>   [SelectVal<"VarFunctionAndLabel", "varaibles, functions, and labels">,
>    SelectVal<"FieldsAndGlobals", "fields and global variables">,
>    // ...
>   ]
>>;
> def err_foo : Error<"%0 attribute only aplpies to
> %select<attr_recipient>1">;
>
> ... where this would generate both the diagnostic with a proper %select and
> also an enumerated type for the attribute argument.

That *would* be handy indeed...

~Aaron



More information about the cfe-commits mailing list