aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/auto-dtor1.C
blob: 0a109fe8a1cbc4ebc1a5879a80c1bc2f55cbde7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// DR 1586
// { dg-do run { target c++1y } }

template <class T>
void f (T* p)
{
  p->~auto();
}

int d;
struct A { ~A() { ++d; } };

int main()
{
  f(new int(42));
  f(new A);
  if (d != 1)
    throw;

  (new int)->~auto();
}