aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1998-03-15 14:54:36 -0500
committerJason Merrill <jason@gcc.gnu.org>1998-03-15 14:54:36 -0500
commiteb56e63578d1d4a4a82ba01ce6747dc3ff56d128 (patch)
treeb81f2213bbd105a9b2bb43d7def823de2acc06fa /gcc
parentcae40af6efc85015875dbf8e5e2210b72d86817a (diff)
downloadgcc-eb56e63578d1d4a4a82ba01ce6747dc3ff56d128.zip
gcc-eb56e63578d1d4a4a82ba01ce6747dc3ff56d128.tar.gz
gcc-eb56e63578d1d4a4a82ba01ce6747dc3ff56d128.tar.bz2
new
From-SVN: r18596
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memclass5.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memclass6.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memclass7.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp43.C30
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ttp44.C17
5 files changed, 84 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memclass5.C b/gcc/testsuite/g++.old-deja/g++.pt/memclass5.C
index 82dbd76..69b3bcc 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memclass5.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memclass5.C
@@ -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
index 0000000..65de1d1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memclass6.C
@@ -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
index 0000000..08166b0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C
@@ -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
index 0000000..a020655
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp43.C
@@ -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
index 0000000..7f797e6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp44.C
@@ -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>;