| 1 |
// PR c++/44909 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// Declaring A<D<E>>'s copy ctor means choosing a ctor to initialize D<E>, |
| 4 |
// which means choosing a ctor for C<B<E>>, which meant considering |
| 5 |
// C(const B<E>&) which means choosing a ctor for B<E>, which means choosing |
| 6 |
// a ctor for A<D<E>>. Cycle. |
| 7 |
|
| 8 |
template<typename T> |
| 9 |
struct A |
| 10 |
{ |
| 11 |
T t; |
| 12 |
}; |
| 13 |
|
| 14 |
template <typename T> |
| 15 |
struct B |
| 16 |
{ |
| 17 |
typename T::U u; |
| 18 |
}; |
| 19 |
|
| 20 |
template <typename T> |
| 21 |
struct C |
| 22 |
{ |
| 23 |
C(const T&); |
| 24 |
}; |
| 25 |
|
| 26 |
template <typename T> |
| 27 |
struct D |
| 28 |
{ |
| 29 |
C<B<T> > v; |
| 30 |
}; |
| 31 |
|
| 32 |
struct E { |
| 33 |
typedef A<D<E> > U; |
| 34 |
}; |
| 35 |
|
| 36 |
extern A<D<E> > a; |
| 37 |
A<D<E> > a2(a); |