Possible UDA bug

jerro a at a.com
Sun Feb 24 10:03:26 PST 2013


> extern(C) int bar();
> @bar() void foo(){}
> //pragma(msg, __traits(getAttributes, foo));
>
> void main()
> {
>     auto x = __traits(getAttributes, foo)[0];
> }
>
> is compilable and runnable when linker knows where bar() is.

So this is actually supposed to work? The documentation says:

> User Defined Attributes (UDA) are compile time expressions that 
> can be attached to a declaration.

I guess the documentation is wrong or at least unclear in that 
case.


More information about the Digitalmars-d mailing list