Debian Codegraph @

gcc/testsuite/gdc.test/compilable/user_defined_attributes.d

raw
1
2 enum Test;
3
4 @true @null @byte int x;
5 @(int) int y;
6 @"test" @`test2` @30 @'a' @__LINE__ void f();
7
8 @Test void h();
9
10 static assert( __traits(getAttributes, x)[0] == true);
11 static assert( __traits(getAttributes, x)[1] == null);
12 static assert(is(__traits(getAttributes, x)[2] == byte));
13
14 static assert(is(__traits(getAttributes, y)[0] == int));
15
16 static assert( __traits(getAttributes, f)[0] == "test");
17 static assert( __traits(getAttributes, f)[1] == "test2");
18 static assert( __traits(getAttributes, f)[2] == 30);
19 static assert( __traits(getAttributes, f)[3] == 'a');
20 static assert( __traits(getAttributes, f)[4] == 6);
21
22 static assert(is(__traits(getAttributes, h)[0] == enum));