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