blob: c33374a3b6bcf725af22a7c778ca8743c8e707b3 [file] [log] [blame]
// PR c++/103711
// { dg-do run { target c++11 } }
int constructions = 0;
int destructions = 0;
struct A
{
A() { constructions++; }
virtual ~A() { destructions++; }
};
struct B : public virtual A
{
B(int) { }
B() : B(1) { throw -1; }
virtual ~B() = default;
};
struct C : public B { };
int main() {
try {
C c;
}
catch (int) {}
return (constructions - destructions);
}