diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/memclass5.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/memclass6.C | 18 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/memclass7.C | 17 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/ttp43.C | 30 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/ttp44.C | 17 |
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>; |