summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/ttp21.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/ttp21.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp21.C34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp21.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp21.C
new file mode 100644
index 000000000..f0b41bf3f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp21.C
@@ -0,0 +1,34 @@
+// { dg-do run }
+template<class T> class D
+{
+ public:
+ int f();
+};
+
+template<class T> int D<T>::f()
+{
+ return sizeof(T);
+}
+
+template<template<class> class D,class E> class C : D<E>
+{
+ public:
+ int g();
+};
+
+template<template<class> class D,class E> int C<D,E>::g()
+{
+ return this->f();
+}
+
+class E : C<D,int>
+{
+ public:
+ int h() { return this->g(); }
+};
+
+int main()
+{
+ E c;
+ c.h();
+}