ttp53.C: New test.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sun, 11 Oct 1998 19:59:27 +0000 (19:59 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Sun, 11 Oct 1998 19:59:27 +0000 (19:59 +0000)
* g++.old-deja/g++.pt/ttp53.C: New test.  incorrect substitution
of template parameter?

From-SVN: r22996

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.pt/ttp53.C [new file with mode: 0644]

index e43637e..81ea86b 100644 (file)
@@ -1,5 +1,8 @@
 1998-10-12  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * g++.old-deja/g++.pt/ttp53.C: New test.  incorrect substitution
+       of template parameter?
+
        * g++.old-deja/g++.other/conv3.C: New test.  conversion discards
        const
 
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 (file)
index 0000000..694635d
--- /dev/null
@@ -0,0 +1,35 @@
+// Build don't link:
+
+// 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); // gets bogus error - candidate - XFAIL *-*-*
+
+#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); // gets bogus error - no match - XFAIL *-*-*
+}
+
+int main(){
+  H<int> i;
+  foo<const int>(i); // gets bogus error - instantiated from here - XFAIL *-*-*
+}