aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted22.C
blob: 5afcd1deae105952c3b67d8a3515e4202e4d3953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Test that a virtual defaulted constructor is still virtual.
// { dg-do run { target c++11 } }

int r = 1;

struct A
{
  virtual ~A() = default;
};

struct B: A
{
  ~B() noexcept { r = 0; }
};

A* ap = new B();

int main()
{
  delete ap;
  return r;
}