]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
new
authorJason Merrill <jason@gcc.gnu.org>
Sun, 15 Mar 1998 19:54:36 +0000 (14:54 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 15 Mar 1998 19:54:36 +0000 (14:54 -0500)
From-SVN: r18596

gcc/testsuite/g++.old-deja/g++.pt/memclass5.C
gcc/testsuite/g++.old-deja/g++.pt/memclass6.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/memclass7.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/ttp43.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/ttp44.C [new file with mode: 0644]

index 82dbd7612cac3c4b2152b470f88afb3f38828bb9..69b3bcc3e17e33c6424a29beddd208e4b9ef9c49 100644 (file)
@@ -13,6 +13,8 @@ void f ()
   typename A<T>::template B<U> b2;
   b.A<T>::template B<U>::~B();
 }
+
+template <class T> struct C: public A<T>::B<T> { };
   
 main ()
 {
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memclass6.C b/gcc/testsuite/g++.old-deja/g++.pt/memclass6.C
new file mode 100644 (file)
index 0000000..65de1d1
--- /dev/null
@@ -0,0 +1,18 @@
+// Compiler: egcs-2.91.12 980302
+// Error:    compiler error in ctor of 'foo::bar<T>::bar(T const &)'
+
+struct foo
+{
+  template <typename T>
+        struct bar
+        {
+          bar(T const &t) : tt(t) {}
+          T tt;
+        };
+};
+
+int main()
+{
+  foo::bar<int> fb(3);
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C b/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C
new file mode 100644 (file)
index 0000000..08166b0
--- /dev/null
@@ -0,0 +1,17 @@
+struct S 
+{
+  template <class U>
+  struct Y {
+    template <class T>
+    void foo(T t);
+
+    template <>
+    void foo<int>(int i) { }
+  };
+};
+
+int main()
+{
+  S::Y<char> s;
+  s.template foo<int>(3.0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp43.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp43.C
new file mode 100644 (file)
index 0000000..a020655
--- /dev/null
@@ -0,0 +1,30 @@
+// Build don't link:
+
+template < class T, template <class> class E1, template <class> class E2 >
+struct Add {
+  Add(const E1<T>& e1, const E2<T>& e2) {}
+};
+
+
+template < class T, template <class> class E1, template <class> class E2 >
+struct Mul {
+  Mul(const E1<T>& e1, const E2<T>& e2) {}
+};
+
+
+template < class T >
+struct Lit {
+  Lit(const T& t) {}
+};
+
+
+template < class T >
+struct Id {
+  Add < T, Id, Lit > operator+(const T& t) const {
+    return Add < T, Id, Lit >(*this, Lit<T>(t));
+  }
+
+  Mul < T, Id, Lit > operator*(const T& t) const {
+    return Mul < T, Id, Lit >(*this, Lit<T>(t));
+  }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp44.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp44.C
new file mode 100644 (file)
index 0000000..7f797e6
--- /dev/null
@@ -0,0 +1,17 @@
+// Build don't link:
+
+template < class T, template < class > class E1, template < class > class E2 >
+class Add {
+public:
+  Add(const E1<T>& e1, const E2<T>& e2) {}
+};
+
+template < class T >
+struct Id {
+  template < template < class > class E >
+  Add < T, Id, E > operator+(const E<T>& e) const {
+    return Add < T, Id, E >(*this, e);
+  }
+};
+
+template struct Id<double>;