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; }