1 // REQUIRED_ARGS: -o-
2 // PERMUTE_ARGS:
3 
foo()4 void foo() {}
5 alias F = typeof(foo);
6 
block_c()7 const        { void block_c() {} }
block_i()8 immutable    { void block_i() {} }
block_w()9 inout        { void block_w() {} }
block_s()10 shared       { void block_s() {} }
block_sc()11 shared const { void block_sc() {} }
block_sw()12 shared inout { void block_sw() {} }
13 
14 static assert(is(typeof(block_c) == F));
15 static assert(is(typeof(block_i) == F));
16 static assert(is(typeof(block_w) == F));
17 static assert(is(typeof(block_s) == F));
18 static assert(is(typeof(block_sc) == F));
19 static assert(is(typeof(block_sw) == F));
20 
version(all)21 version (all) { const:        void label_c() {} }
version(all)22 version (all) { immutable:    void label_i() {} }
version(all)23 version (all) { inout:        void label_w() {} }
version(all)24 version (all) { shared:       void label_s() {} }
version(all)25 version (all) { shared const: void label_sc() {} }
version(all)26 version (all) { shared inout: void label_sw() {} }
27 
28 static assert(is(typeof(label_c) == F));
29 static assert(is(typeof(label_i) == F));
30 static assert(is(typeof(label_w) == F));
31 static assert(is(typeof(label_s) == F));
32 static assert(is(typeof(label_sc) == F));
33 static assert(is(typeof(label_sw) == F));
34 
35 class C
36 {
block_c()37     const        { static void block_c() {} }
block_i()38     immutable    { static void block_i() {} }
block_w()39     inout        { static void block_w() {} }
block_s()40     shared       { static void block_s() {} }
block_sc()41     shared const { static void block_sc() {} }
block_sw()42     shared inout { static void block_sw() {} }
43 
44     static assert(is(typeof(block_c) == F));
45     static assert(is(typeof(block_i) == F));
46     static assert(is(typeof(block_w) == F));
47     static assert(is(typeof(block_s) == F));
48     static assert(is(typeof(block_sc) == F));
49     static assert(is(typeof(block_sw) == F));
50 
version(all)51     version (all) { const:        static void label_c() {} }
version(all)52     version (all) { immutable:    static void label_i() {} }
version(all)53     version (all) { inout:        static void label_w() {} }
version(all)54     version (all) { shared:       static void label_s() {} }
version(all)55     version (all) { shared const: static void label_sc() {} }
version(all)56     version (all) { shared inout: static void label_sw() {} }
57 
58     static assert(is(typeof(label_c) == F));
59     static assert(is(typeof(label_i) == F));
60     static assert(is(typeof(label_w) == F));
61     static assert(is(typeof(label_s) == F));
62     static assert(is(typeof(label_sc) == F));
63     static assert(is(typeof(label_sw) == F));
64 }
65