summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/ttp27.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/ttp27.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp27.C36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp27.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp27.C
new file mode 100644
index 000000000..e29b83e23
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp27.C
@@ -0,0 +1,36 @@
+// { dg-do run }
+template<class T> class D
+{
+ public:
+ int f() const;
+};
+
+template<class T> int D<T>::f() const
+{
+ return sizeof(T);
+}
+
+template<template<class> class D,class E> class C
+{
+ D<E> d;
+ public:
+ int f() const { return d.f(); }
+};
+
+template<template<class> class D,class E> int f(const D<E> &d1)
+{
+ d1.f();
+ C<D,E> d2;
+ d2.f();
+ return 0;
+}
+
+int main()
+{
+ D<const int> c1;
+ D<char> c2;
+ const D<char> c3(c2);
+ f(c1);
+ f(c2);
+ f(c3);
+}