aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/opt/declone1.C
blob: 1f935b7e399a3991bc0b8b4bf6fb0afd75fe7a38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-options "-fdeclone-ctor-dtor -O3" }

struct V {};

template <class T>
struct A: virtual V {
  static A* p;
  A();
};

template <class T>
A<T>::A()
{
  if (!p)
    p = new A();
}

int main()
{
  A<int> a;
}