1 // https://issues.dlang.org/show_bug.cgi?id=21861
13 // OK <- CTFE fails on this:
17 // OK <- CTFE fails on this:
19 int f(int x
) { return x
+ 2; }
21 // OK <- CTFE fails on this:
23 @
(1) @
(2) int b
= 4, c
;
24 @
(3) extern(C
) int d
= 3;
26 enum uda1
= __traits(getAttributes
, a
);
27 enum uda2
= __traits(getAttributes
, b
);
28 enum uda3
= __traits(getAttributes
, c
);
30 // These are to trigger a compiler assert if parser is updated in the future
31 static assert(!__traits(compiles
, mixin("{ @(1) { int x; int y; } }")));
32 static assert(!__traits(compiles
, mixin("{ @(1): int x; int y; }")));
35 return uda1
[0](3) + uda2
[0] + uda2
[1] + b
+ uda3
[0] + d
;
38 static assert(f() == 16);