summaryrefslogtreecommitdiff
path: root/libphobos/testsuite/libphobos.typeinfo/enum_.d
blob: 58cfbe34d6089032d6912a93a24df269c4524bdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// https://issues.dlang.org/show_bug.cgi?id=21441

int dtorCount;
int postblitCount;

struct S
{
    this(this) { ++postblitCount; }
    ~this() { ++dtorCount; }
}

enum E : S { _ = S.init }

void main()
{
    E e;
    typeid(e).destroy(&e);
    assert(dtorCount == 1);
    typeid(e).postblit(&e);
    assert(postblitCount == 1);
}