From eb56e63578d1d4a4a82ba01ce6747dc3ff56d128 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sun, 15 Mar 1998 14:54:36 -0500 Subject: [PATCH] new From-SVN: r18596 --- gcc/testsuite/g++.old-deja/g++.pt/memclass5.C | 2 ++ gcc/testsuite/g++.old-deja/g++.pt/memclass6.C | 18 +++++++++++ gcc/testsuite/g++.old-deja/g++.pt/memclass7.C | 17 +++++++++++ gcc/testsuite/g++.old-deja/g++.pt/ttp43.C | 30 +++++++++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/ttp44.C | 17 +++++++++++ 5 files changed, 84 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/memclass6.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/memclass7.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp43.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp44.C diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memclass5.C b/gcc/testsuite/g++.old-deja/g++.pt/memclass5.C index 82dbd7612ca..69b3bcc3e17 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::template B b2; b.A::template B::~B(); } + +template struct C: public A::B { }; 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 00000000000..65de1d1bd99 --- /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::bar(T const &)' + +struct foo +{ + template + struct bar + { + bar(T const &t) : tt(t) {} + T tt; + }; +}; + +int main() +{ + foo::bar 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 00000000000..08166b0220d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C @@ -0,0 +1,17 @@ +struct S +{ + template + struct Y { + template + void foo(T t); + + template <> + void foo(int i) { } + }; +}; + +int main() +{ + S::Y s; + s.template foo(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 00000000000..a020655b131 --- /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 E1, template class E2 > +struct Add { + Add(const E1& e1, const E2& e2) {} +}; + + +template < class T, template class E1, template class E2 > +struct Mul { + Mul(const E1& e1, const E2& 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)); + } + + Mul < T, Id, Lit > operator*(const T& t) const { + return Mul < T, Id, Lit >(*this, Lit(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 00000000000..7f797e6dd86 --- /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& e1, const E2& e2) {} +}; + +template < class T > +struct Id { + template < template < class > class E > + Add < T, Id, E > operator+(const E& e) const { + return Add < T, Id, E >(*this, e); + } +}; + +template struct Id; -- 2.30.2