aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/cleanup4.C
blob: b9769e3bbeb6acb36c8cc25b753ef1984df06381 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/79679
// { dg-do run }

int count;
struct S {
    S() { ++count; }
    S(const S&) { ++count; }
    ~S() { --count; }
};

struct T {
    T(S) {}
};

int main() {
  {
    S s;
    T u(s);
  }
  if (count)
    __builtin_abort();
}