summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/partial4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/partial4.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/partial4.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/partial4.C b/gcc/testsuite/g++.old-deja/g++.pt/partial4.C
new file mode 100644
index 000000000..fd3554e55
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/partial4.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// Origin: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
+
+// Bug 29. We failed to verify that template argument deduction
+// produces a valid result in nondeduce context.
+
+template<class T> struct Y { typedef T X; };
+
+template<class T, class U> struct Base {};
+
+template<class T> struct Base<T, typename T::X> {};
+
+template<class T> struct Base<typename T::X, T> {};
+
+template<class T, class U> struct Derived : Base <T, U> {};
+
+struct A {};
+
+template<class T> struct Derived<A, T> : Base< Y<T>, Y<T> > {};
+
+int main()
+{
+ Derived<A, int> d;
+}