summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/implicit7.C
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-23 19:37:40 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-23 19:37:40 +0000
commit10ada81fea4490f94ba2eb5923bf5baa367a38bd (patch)
tree437dca120093cc7b1f6debf6f6b31779526c7192 /gcc/testsuite/g++.dg/cpp0x/implicit7.C
parent95a236de8aa10bf009e9368dfd28f95a980e5570 (diff)
parent3bd7a983695352a99f7dd597725eb5b839d4b4cf (diff)
downloadgcc-ifunc.tar.gz
Merged with trunk at revision 162480.ifunc
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ifunc@162483 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/implicit7.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit7.C37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit7.C b/gcc/testsuite/g++.dg/cpp0x/implicit7.C
new file mode 100644
index 00000000000..f29e5009fbd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit7.C
@@ -0,0 +1,37 @@
+// PR c++/44909
+// { dg-options -std=c++0x }
+// 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);