aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit7.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit7.C37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit7.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit7.C
new file mode 100644
index 0000000..eaa7d82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit7.C
@@ -0,0 +1,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);