OSDN Git Service

/cp
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / implicit7.C
1 // PR c++/44909
2 // { dg-options -std=c++0x }
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);