[cfe-dev] Enum parameters for a C++11 Attribute

Aaron Ballman aaron at aaronballman.com
Fri Dec 19 07:10:03 PST 2014


On Fri, Dec 19, 2014 at 7:09 AM, LUIS MIGUEL SANCHEZ GARCIA
<lmsanche at inf.uc3m.es> wrote:
> It is something like that:
>
> file: include/clang/Basic/Attr.td
>
> def OWNmyattr : Attr {
>   let Spellings = [CXX11<"own", "myattr">];
>   let Args = [VariadicEnumArgument<"Color", "ColorType",
>                            ["RED", "BLUE","GREEN"],
>                            ["RED", "BLUE","GREEN"]>];
>   let Documentation = [Undocumented];
> }

That definition looks reasonable to me; what problems are you running into?

~Aaron
>
>
>
>
> Thanks,
>
> Regards,
> Luis.
>
> 2014-12-18 22:19 GMT+01:00 Aaron Ballman <aaron at aaronballman.com>:
>>
>> On Thu, Dec 18, 2014 at 4:48 AM, LUIS MIGUEL SANCHEZ GARCIA
>> <luismiguel.sanchez at uc3m.es> wrote:
>> > I tried to include a variadic parameter into a c++11 attribute:
>> >
>> > Example:
>> >
>> > int main(){
>> > ....
>> > [[my::ownattr(RED, BLUE)]]
>> > f();
>> > ....
>> > }
>> >
>> >
>> >
>> > being A and B values of an enumerate like:
>> > enum class Color {RED, GREEN, BLUE};
>> >
>> > Any help?
>>
>> What does your attribute's table definition look like? What problems
>> are you running into?
>>
>> ~Aaron
>
>
>
> --
> --
> --
> --------------------------------------------------
> Luis Miguel Sánchez García
> Computer Architecture and Technology Area.
> Office 2.2.B08
> Computer Science Department. UNIVERSIDAD CARLOS III DE MADRID
> Universidad Carlos III de Madrid
> Avda. de la Universidad, 30
> 28911 Leganés - Madrid - Spain
> e-mail: lmsan at arcos.inf.uc3m.es
>         luismiguel.sanchez at uc3m.es
>
> Phone: (+34) 91 624 5951
>
> Linked-In: http://es.linkedin.com/in/lmsan
> Twitter: http://twitter.com/lmsanchezgarcia
> --------------------------------------------------




More information about the cfe-dev mailing list