summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/ttp53.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp53.C35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C
new file mode 100644
index 000000000..b43771c8c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C
@@ -0,0 +1,35 @@
+// { dg-do assemble }
+
+// Submitted by Erez Louidor Lior <s3824888@techst02.technion.ac.il>
+
+template <typename> class H;
+template <typename Target, typename Source>
+H<Target> foo(const H<Source>&);
+
+template <typename Type>
+class H{
+
+#ifdef OK
+public:
+#endif
+ template<template<class, class> class Caster, typename Source>
+ static H<Type> cast(const H<Source>& s);
+
+#ifndef OK
+ template <typename Target, typename Source>
+ friend H<Target> foo(const H<Source>&);
+#endif
+
+};
+
+template <class, class> class caster;
+
+template <typename Target, typename Source>
+H<Target> foo(const H<Source>& s){
+ return H<Target>::template cast<caster, Source>(s);
+}
+
+int main(){
+ H<int> i;
+ foo<const int>(i);
+}