aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@dcc.unicamp.br>1998-10-11 19:59:27 +0000
committerAlexandre Oliva <oliva@gcc.gnu.org>1998-10-11 19:59:27 +0000
commit411e094cbee542f2e94492a72b9d62b8b00aaba2 (patch)
treeb6923d98074ef5afafd979a8355c96ad0127b78d
parent7c7bfd91142be0173cfbbf8606e18c5c3275f2a9 (diff)
downloadgcc-411e094cbee542f2e94492a72b9d62b8b00aaba2.zip
gcc-411e094cbee542f2e94492a72b9d62b8b00aaba2.tar.gz
gcc-411e094cbee542f2e94492a72b9d62b8b00aaba2.tar.bz2
ttp53.C: New test.
* g++.old-deja/g++.pt/ttp53.C: New test. incorrect substitution of template parameter? From-SVN: r22996
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp53.C35
2 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e43637e..81ea86b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..694635d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C
@@ -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 *-*-*
+}