1 /*
2 REQUIRED_ARGS: -unittest
3 TEST_OUTPUT:
4 ---
5 fail_compilation/fail14249.d(23): Error: shared static constructor can only be member of module/aggregate/template, not function main
6 fail_compilation/fail14249.d(24): Error: shared static destructor can only be member of module/aggregate/template, not function main
7 fail_compilation/fail14249.d(25): Error: static constructor can only be member of module/aggregate/template, not function main
8 fail_compilation/fail14249.d(26): Error: static destructor can only be member of module/aggregate/template, not function main
9 fail_compilation/fail14249.d(27): Error: unittest can only be a member of module/aggregate/template, not function main
10 fail_compilation/fail14249.d(28): Error: invariant can only be a member of aggregate, not function main
11 fail_compilation/fail14249.d(29): Error: alias this can only be a member of aggregate, not function `main`
12 fail_compilation/fail14249.d(30): Error: allocator can only be a member of aggregate, not function main
13 fail_compilation/fail14249.d(31): Error: deallocator can only be a member of aggregate, not function main
14 fail_compilation/fail14249.d(32): Error: constructor can only be a member of aggregate, not function main
15 fail_compilation/fail14249.d(33): Error: destructor can only be a member of aggregate, not function main
16 fail_compilation/fail14249.d(34): Error: postblit can only be a member of struct/union, not function main
17 fail_compilation/fail14249.d(35): Error: anonymous union can only be a part of an aggregate, not function `main`
18 fail_compilation/fail14249.d(39): Error: mixin fail14249.main.Mix!() error instantiating
19 ---
20 */
Mix()21 mixin template Mix()
22 {
23     shared static this() {}
24     shared static ~this() {}
25     static this() {}    // from fail197.d, 1510 ICE: Assertion failure: 'ad' on line 925 in file 'func.c'
26     static ~this() {}
27     unittest {}
28     invariant {}
29     alias a this;
30     new(size_t sz) { return null; }
31     delete(void* p) { }
32     this() {}           // from fail268.d
33     ~this() {}          // from fail268.d
34     this(this) {}
35     union { int x; double y; }
36 }
37 void main()
38 {
39     mixin Mix!();
40 }
41