aboutsummaryrefslogtreecommitdiffstats
path: root/tests/rule-of-three/bug403193.cpp
blob: 099d20deeeb12b703fe8f9d437200a3624a963de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class APrivate
{
public:
    int i = 3;
};

class A
{
public:
    A() : d(new APrivate()) {}
    A(const A &other) : d(new APrivate(*other.d)) {}
    ~A() { delete d; }
private:
    APrivate *const d;
};

void test()
{
    A a;
    A a2;
}