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

LUIS MIGUEL SANCHEZ GARCIA luismiguel.sanchez at uc3m.es
Fri Dec 19 05:50:23 PST 2014


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];*
*}*




Thanks,

Regards,
Luis.

2014-12-19 13:09 GMT+01:00 LUIS MIGUEL SANCHEZ GARCIA <lmsanche at inf.uc3m.es>
:
>
> 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];*
> *}*
>
>
>
>
> 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
> --------------------------------------------------
>


-- 
-- 
-- 
--------------------------------------------------
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
--------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141219/78066eb0/attachment.html>


More information about the cfe-dev mailing list