aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit7.C
blob: eaa7d82ae520226a015543d720b15fe70504fb56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// PR c++/44909
// { dg-do compile { target c++11 } }
// Declaring A<D<E>>'s copy ctor means choosing a ctor to initialize D<E>,
// which means choosing a ctor for C<B<E>>, which meant considering
// C(const B<E>&) which means choosing a ctor for B<E>, which means choosing
// a ctor for A<D<E>>.  Cycle.

template<typename T>
struct A
{
  T t;
};

template <typename T>
struct B
{
  typename T::U u;
};

template <typename T>
struct C
{
  C(const T&);
};

template <typename T>
struct D
{
  C<B<T> > v;
};

struct E {
  typedef A<D<E> > U;
};

extern A<D<E> > a;
A<D<E> > a2(a);