Debian Codegraph @

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

raw
1 // REQUIRED_ARGS: -c
2 struct S0 { this(this) {} }
3 struct S1 { S0[2] x; }
4 struct S2 { S0[0] x; }
5
6 // S0 has an explicit and a compiler-generated postblit
7 static assert( __traits(hasMember, S0, "__postblit"));
8 static assert( __traits(hasMember, S0, "__xpostblit"));
9 // S1 has only the compiler-generated postblit
10 static assert(!__traits(hasMember, S1, "__postblit"));
11 static assert( __traits(hasMember, S1, "__xpostblit"));
12 // S2 has no postblit at all since the x array has zero length
13 static assert(!__traits(hasMember, S2, "__postblit"));
14 static assert(!__traits(hasMember, S2, "__xpostblit"));