diff options
author | Jason Merrill <jason@gcc.gnu.org> | 1997-09-09 23:34:51 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1997-09-09 23:34:51 -0400 |
commit | 1dec6c7b3dbbd4f8e44487e48a7c5893542d2f67 (patch) | |
tree | 5c38e43c35c9c457657fb413c4ebed6fc641accb /gcc | |
parent | 2ca340aed3cef22d7d9a37a2d8bf393e77bb0ea1 (diff) | |
download | gcc-1dec6c7b3dbbd4f8e44487e48a7c5893542d2f67.zip gcc-1dec6c7b3dbbd4f8e44487e48a7c5893542d2f67.tar.gz gcc-1dec6c7b3dbbd4f8e44487e48a7c5893542d2f67.tar.bz2 |
new testcases
From-SVN: r15214
Diffstat (limited to 'gcc')
53 files changed, 1107 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/enum.C b/gcc/testsuite/g++.old-deja/g++.pt/enum.C new file mode 100644 index 0000000..4fe84a4 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/enum.C @@ -0,0 +1,18 @@ +// Build don't link: +// GROUPS passed enums +template<class T> +struct templ +{ + enum { val = 0 }; +}; +struct Foo +{ + enum { + bar = 0, + len = templ<int>::val + }; +}; +void func() +{ + int s = Foo::bar; // Ensure that expansion of templ did not erase bar +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp1.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp1.C new file mode 100644 index 0000000..94274e5 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp1.C @@ -0,0 +1,15 @@ +// Build don't link: +// GROUPS passed templates membertemplates +struct S { + template <class T> + void foo(T&); +}; + + +template <class T> +void S::foo(T&) +{ +} + + + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp10.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp10.C new file mode 100644 index 0000000..9e97b5e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp10.C @@ -0,0 +1,24 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S { + template <class T> + operator T*(); +}; + + +template <class T> +S::operator T*() +{ + printf("Hello, world.\n"); + return 0; +} + + +int main() +{ + S s; + + char* cp = s.operator char*(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C new file mode 100644 index 0000000..a0d681d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C @@ -0,0 +1,27 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S +{ + template <class U> + S(U u, int i) {} + + template <class T> + T foo(T t) + { + printf("Hello, world.\n"); + return t; + } +}; + + +int main() +{ + S s(3, 4); + int i = s.foo(3); + s.foo("hello"); + s.foo(s); + + S s2("hello", 5); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp12.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp12.C new file mode 100644 index 0000000..94a8c3c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp12.C @@ -0,0 +1,13 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class T> +struct S +{ + template <class U> + void foo(U); +}; + +void f() +{ + S<int> s; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp13.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp13.C new file mode 100644 index 0000000..d6bc7b9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp13.C @@ -0,0 +1,15 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class T> +struct S +{ + template <class U> + void foo(U); +}; + +void f() +{ + S<int> s; + s.foo(3); + s.foo("hello"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp14.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp14.C new file mode 100644 index 0000000..e24a3a7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp14.C @@ -0,0 +1,30 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" const char* printf(const char*, ...); + +template <class T> +struct S +{ + template <class U, class V> + void foo(U, V); +}; + + +template <class T> +template <class U, class V> +void S<T>::foo(U, V) +{ + printf("Hello, world.\n"); +} + + +int main() +{ + S<int> s; + s.foo(3, 3); + s.foo("hello", s); + + S<char*> s2; + s2.foo(3, 3); + s2.foo("hello", s); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp15.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp15.C new file mode 100644 index 0000000..140730b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp15.C @@ -0,0 +1,16 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class T> +struct S +{ + template <class U> + void foo(U) {} +}; + + +void f() +{ + S<int> s; + s.foo(3); + s.foo("hello"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp16.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp16.C new file mode 100644 index 0000000..cfa66aa --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp16.C @@ -0,0 +1,30 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class U> +struct S { + template <class T> + void operator+(T); +}; + +template <class U> +template <class T> +void S<U>::operator+(T) +{ + printf("Hello, world.\n"); +} + + +int main() +{ + S<int> s; + s + 3; + s + s; + s.operator+("Hi"); + + S<S<int> > s2; + s2 + 3; + s2 + s; + s2.operator+("Hi"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp17.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp17.C new file mode 100644 index 0000000..0816b36 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp17.C @@ -0,0 +1,26 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class V> +struct S { + template <class T, class U> + S(T, U, T); +}; + + +template <class V> +template <class T, class U> +S<V>::S(T t1, U u1, T t2) +{ + printf("Hello, world.\n"); +} + + +int main() +{ + S<int> s1(3, "abc", 3); + S<int> s2('a', s1, 'a'); + + S<char> s3("abc", 3, "abc"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp18.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp18.C new file mode 100644 index 0000000..c9b76c3 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp18.C @@ -0,0 +1,16 @@ +// Build don't link: +// GROUPS passed templates membertemplates +struct S +{ + template <class T> + void foo(T); +}; + +template void S::foo(int); + +int main() +{ + S s; + s.foo(3); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp19.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp19.C new file mode 100644 index 0000000..8551531 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp19.C @@ -0,0 +1,25 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S { + template <class T> + operator T(); +}; + +template <class T> +S::operator T() +{ + printf("Hello, world.\n"); + return T(); +} + + +template S::operator int(); + +int main() +{ + S s; + + int i = s.operator int(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp2.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp2.C new file mode 100644 index 0000000..e000ffa --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp2.C @@ -0,0 +1,15 @@ +// Build don't link: +// GROUPS passed templates membertemplates +struct S { + template <class T> + void foo(T&); +}; + + +template <class U> +void S::foo(U&) +{ +} + + + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp20.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp20.C new file mode 100644 index 0000000..29f0aa1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp20.C @@ -0,0 +1,45 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S +{ + template <class T, class U> + void foo(T t, U u); + + template <class U> + void foo(char*, U); + + template <> + void foo(int i); +}; + +template <class T, class U> +void S::foo(T t, U u) +{ + printf ("T,U version\n"); +} + + +template <class U> +void S::foo(char*, U u) +{ + printf ("char*,U version\n"); +} + + +template <> +void S::foo(int i) +{ + printf ("int version\n"); +} + + +int main() +{ + S s; + s.foo(3); + s.foo(3, 3); + s.foo("abc", s); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C new file mode 100644 index 0000000..5310b62 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp23.C @@ -0,0 +1,24 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + S() + { printf ("In S::S()\n"); f(3); } + + S(char) + { printf ("In S::S(char)\n"); f(*this); } + + template <class U> + void f(U u) + { printf ("In S::f(U)\nsizeof(U) == %d\n", sizeof(u)); } + + int c[16]; +}; + +int main() +{ + S<char*> s; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C new file mode 100644 index 0000000..b1bfac1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp24.C @@ -0,0 +1,25 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + S() + { printf ("In S::S()\n"); f(3); } + + S(char) + { printf ("In S::S(char)\n"); f(*this); } + + template <class U> + void f(U u) + { printf ("In S::f(U)\nsizeof(U) == %d\n", sizeof(u)); } + + int c[16]; +}; + +int main() +{ + S<char*> s; + S<char*> s2('a'); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C new file mode 100644 index 0000000..672a9c8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp25.C @@ -0,0 +1,20 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + template <class U> + void f(U u) { printf ("%d\n", sizeof (U)); } + + int i[4]; +}; + + +int main() +{ + S<char*> s; + s.f(3); + s.f(s); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C new file mode 100644 index 0000000..cbfc93e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp26.C @@ -0,0 +1,28 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + template <class U> + void f(U u); + + int i[4]; +}; + + +template <class X> +template <class U> +void S<X>::f(U u) +{ + printf ("%d\n", sizeof (U)); +} + + +int main() +{ + S<char*> s; + s.f(3); + s.f(s); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp27.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp27.C new file mode 100644 index 0000000..b1bfac1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp27.C @@ -0,0 +1,25 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + S() + { printf ("In S::S()\n"); f(3); } + + S(char) + { printf ("In S::S(char)\n"); f(*this); } + + template <class U> + void f(U u) + { printf ("In S::f(U)\nsizeof(U) == %d\n", sizeof(u)); } + + int c[16]; +}; + +int main() +{ + S<char*> s; + S<char*> s2('a'); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp28.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp28.C new file mode 100644 index 0000000..ab3ce2d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp28.C @@ -0,0 +1,24 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + template <class U> + void f(U u) + { printf ("In S::f(U)\n"); g(u); } + + template <class U> + void g(U u) + { printf ("In S::g(U)\n"); } + + int c[16]; +}; + +int main() +{ + S<char*> s; + s.f(3); + s.f("adf"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp29.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp29.C new file mode 100644 index 0000000..4000070 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp29.C @@ -0,0 +1,32 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + template <class U> + void f(U u); + + template <class U> + void g(U U); + + int c[16]; +}; + +template <class X> +template <class U> +void S<X>::f(U u) + { printf ("In S::f(U)\n"); g(u); } + +template <class X> +template <class U> +void S<X>::g(U u) + { printf ("In S::g(U)\n"); } + +int main() +{ + S<char*> s; + s.f(3); + s.f("adf"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp3.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp3.C new file mode 100644 index 0000000..2a4dbb85 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp3.C @@ -0,0 +1,24 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S { + template <class T> + void foo(T); +}; + + +template <class T> +void S::foo(T) +{ + printf("Hello, world.\n"); +} + + + +int main() +{ + S s; + s.foo(3); + s.foo(s); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp30.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp30.C new file mode 100644 index 0000000..923ec85 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp30.C @@ -0,0 +1,17 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + template <class U> + void g(U u) { this; } +}; + + +int main() +{ + S<char*> s; + s.g(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp31.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp31.C new file mode 100644 index 0000000..3bb1cd3 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp31.C @@ -0,0 +1,16 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S +{ + template <class U> + void g(U u) + { this; } +}; + +int main() +{ + S s; + s.g(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp32.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp32.C new file mode 100644 index 0000000..3f0bfc7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp32.C @@ -0,0 +1,18 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S +{ + template <class U> + void g(U u) + { i = 3; } + + int i; +}; + +int main() +{ + S s; + s.g(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp33.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp33.C new file mode 100644 index 0000000..500abe0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp33.C @@ -0,0 +1,19 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class T> +struct S +{ + template <class U> + void g(U u) + { i; } + + int i; +}; + +int main() +{ + S<char> s; + s.g(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp34.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp34.C new file mode 100644 index 0000000..29e1101 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp34.C @@ -0,0 +1,16 @@ +// Build don't run: +// GROUPS passed templates membertemplates +template <class T> +struct S +{ + template <class U> + static void f(U u) + {} +}; + +int main() +{ + S<int>::f(3); + S<char>::f("abc"); + S<int>::f("abc"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp35.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp35.C new file mode 100644 index 0000000..7603d94 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp35.C @@ -0,0 +1,21 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class T> +struct S +{ + S(const S& s) {} + + template <class U> + S(S<U>& s) + { + S<U> s2(s); + } +}; + + +extern S<int>& si; + +void foo() +{ + S<char*> sc(si); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp36.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp36.C new file mode 100644 index 0000000..6c57a97 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp36.C @@ -0,0 +1,21 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class X> +struct R +{ +}; + + +template <class T> +struct S +{ + template <class U> + S(R<U> r); +}; + + +void foo() +{ + R<int> r; + S<char*> s(r); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp37.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp37.C new file mode 100644 index 0000000..186083b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp37.C @@ -0,0 +1,20 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class T> +struct S +{ + template <class U> + void f(U u); +}; + + +template <class T> +template <class U> +void S<T>::f(U) +{ +} + +enum +{ + a = 3 +}; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp39.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp39.C new file mode 100644 index 0000000..146d329 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp39.C @@ -0,0 +1,17 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class T> +struct S +{ + template <class U> + void f(U u) { g(u); } + + template <class U> + void g(U u) { f(u); } +}; + +void foo() +{ + S<int> si; + si.f(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp4.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp4.C new file mode 100644 index 0000000..b9f9c16 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp4.C @@ -0,0 +1,12 @@ +// Build don't link: +// GROUPS passed templates membertemplates +struct S { + template <class T> + void operator+(T); +}; + + +template <class T> +void S::operator+(T) +{ +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp40.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp40.C new file mode 100644 index 0000000..70506f0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp40.C @@ -0,0 +1,21 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class T> +struct R +{ + template <class U> + void g(U u) {} +}; + +template <class T> +struct S +{ + template <class U> + void f(U u) { R<T> r; r.g(u); } +}; + +void foo() +{ + S<int> si; + si.f("abc"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp41.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp41.C new file mode 100644 index 0000000..603f702 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp41.C @@ -0,0 +1,7 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <int i> +struct S +{ + static void foo() {} +}; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp42.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp42.C new file mode 100644 index 0000000..3c11dd4 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp42.C @@ -0,0 +1,22 @@ +// Build don't run: +// GROUPS passed templates membertemplates +template<class T, int N> +class Foo { + +public: + template<int N2> + Foo<T,N> operator=(const Foo<T,N2>& z) + { + return Foo<T,N>(); + } +}; + +int main() +{ + Foo<double,4> x; + Foo<double,7> y; + x = y; + + return 0; +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp43.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp43.C new file mode 100644 index 0000000..0948f82 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp43.C @@ -0,0 +1,16 @@ +// Build don't run: +// GROUPS passed templates membertemplates +template<class T, int N> +class A +{ +public: + template<class U> + void operator=(A<U, N> const & a) { return; } +}; + +main() +{ + A<float, 3> a; + A<double, 3> b; + a = b; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp44.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp44.C new file mode 100644 index 0000000..e6d2f87 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp44.C @@ -0,0 +1,20 @@ +// Build don't run: +// GROUPS passed templates membertemplates +template<class T> +class A +{ +}; + +template<> +class A<float> +{ +public: + template<class U> + void func(U v1) {} +}; + +main() +{ + A<float> a; + a.func(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp45.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp45.C new file mode 100644 index 0000000..f8bb478 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp45.C @@ -0,0 +1,20 @@ +// Build don't run: +// GROUPS passed templates membertemplates +template<class T> +class A +{ +}; + +template<> +class A<float> +{ +public: + template<class U> + void func(U v1 = 0) {} +}; + +main() +{ + A<float> a; + a.func(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp46.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp46.C new file mode 100644 index 0000000..e841ae8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp46.C @@ -0,0 +1,20 @@ +// Build don't run: +// GROUPS passed templates membertemplates +template<class T, class U> +class A +{ +}; + +template<class U> +class A<float, U> +{ +public: + template <class V> + void func(V v1 = 0) {} +}; + +main() +{ + A<float, int> a; + a.func("abc"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp47.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp47.C new file mode 100644 index 0000000..e4f7ebf --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp47.C @@ -0,0 +1,29 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +template <class X> +struct S +{ + template <class U> + void g(U u) + { printf ("In S::g(U)\n"); } + + int c[16]; +}; + + +template <class X> +struct T : public S<X> +{ + template <class U> + void f(U u) + { printf ("In T::f(U)\n"); g(u); } +}; + +int main() +{ + T<char*> t; + t.f(3); + t.f("adf"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp48.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp48.C new file mode 100644 index 0000000..8ce6f66 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp48.C @@ -0,0 +1,15 @@ +// Build don't link: +// GROUPS passed templates membertemplates +struct S +{ + template <class T> + void f(T t1, T t = T()) + {} +}; + + +void foo() +{ + S si; + si.f(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp49.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp49.C new file mode 100644 index 0000000..f2d610f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp49.C @@ -0,0 +1,16 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <class X> +struct S +{ + template <class T> + void f(T t1, T t = T()) + {} +}; + + +void foo() +{ + S<int> si; + si.f(3); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C new file mode 100644 index 0000000..14647a3 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C @@ -0,0 +1,25 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S { + template <class T> + void operator+(T); +}; + + +template <class T> +void S::operator+(T) +{ + printf("Hello, world.\n"); +} + + + +int main() +{ + S s; + s + 3; + s + s; + s.operator+("Hi"); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp52.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp52.C new file mode 100644 index 0000000..25dc7e7 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp52.C @@ -0,0 +1,20 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template<class T, int N> +class A { }; + +template<int N> +struct X { + template<class T2, int N2> + void f(A<T2,N>&, A<int,N2>&) + { } +}; + + +void foo() +{ + X<3> x; + A<char*, 3> a1; + A<int, 2> a2; + x.f(a1, a2); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp53.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp53.C new file mode 100644 index 0000000..4fd65b9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp53.C @@ -0,0 +1,36 @@ +// Build don't run: +// GROUPS passed templates membertemplates +template<int N> +struct I { +}; + +template<class T> +struct A { + + int r; + + template<class T1, class T2> + void operator()(T1, T2) + { r = 0; } + + template<int N1, int N2> + void operator()(I<N1>, I<N2>) + { r = 1; } +}; + +int main() +{ + A<float> x; + I<0> a; + I<1> b; + + x(a,b); + if (x.r != 1) + return 1; + + x(float(), double()); + if (x.r != 0) + return 1; + + return 0; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp55.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp55.C new file mode 100644 index 0000000..b955189 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp55.C @@ -0,0 +1,10 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template<class X> class _bz_update { }; + +template<class T> +struct S { +template<int N_destRank> +void foo() { _bz_update<int>(); } +}; + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp56.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp56.C new file mode 100644 index 0000000..ef6b286 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp56.C @@ -0,0 +1,15 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template<class P_numtype, int N_length> +class TinyVector {}; + +template<class P_numtype, int N_rank> +struct Array +{ + template<int N_rank2> + Array() {} + + template<int N_rank2> + P_numtype operator()(const TinyVector<int,N_rank2>& index) const {} +}; + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp58.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp58.C new file mode 100644 index 0000000..a64adeb --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp58.C @@ -0,0 +1,29 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template<int N, class T> +struct B { +}; + +template<int N1, int N2, int N3> +struct D { + struct E { + template<int N4, class T> + static void f(B<N4,T>) + { } + }; +}; + +template<int N> +struct A { + template<int N2, class T, int N3> + static void f(B<N2,T>, B<N3,T> b) + { + D<N2,N3,N>::E::f(b); + } +}; + +void foo() +{ + A<5>::f(B<5,float>(),B<3,float>()); +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp59.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp59.C new file mode 100644 index 0000000..fbdc0d8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp59.C @@ -0,0 +1,22 @@ +// Build don't link: +// GROUPS passed templates membertemplates +template <int N> +struct IndexPlaceholder {}; + +template <int N1, int N2, int N3> +struct ArrayIndexMapping {}; + +template <class T_numtype, int N_rank> +struct Array +{ + template<int N0, int N1> + ArrayIndexMapping<N_rank, N0, N1> + f(IndexPlaceholder<N0>, IndexPlaceholder<N1>); +}; + + +template <class T_numtype> +void foo(T_numtype) +{ + Array<T_numtype, 1> t; +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp6.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp6.C new file mode 100644 index 0000000..6989a7d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp6.C @@ -0,0 +1,13 @@ +// Build don't link: +// GROUPS passed templates membertemplates +struct S { + template <class T, class U> + S(T, U, T); +}; + + +template <class T, class U> +S::S(T, U, T) +{ +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp7.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp7.C new file mode 100644 index 0000000..2dee058 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp7.C @@ -0,0 +1,22 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S { + template <class T, class U> + S(T, U, T); +}; + + +template <class T, class U> +S::S(T t1, U u1, T t2) +{ + printf("Hello, world.\n"); +} + + +int main() +{ + S s1(3, "abc", 3); + S s2('a', s1, 'a'); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp8.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp8.C new file mode 100644 index 0000000..1bf0890 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp8.C @@ -0,0 +1,13 @@ +// Build don't link: +// GROUPS passed templates membertemplates +struct S { + template <class T> + operator T(); +}; + + +template <class T> +S::operator T() +{ +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp9.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp9.C new file mode 100644 index 0000000..943dbfb --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp9.C @@ -0,0 +1,22 @@ +// Build don't run: +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S { + template <class T> + operator T(); +}; + +template <class T> +S::operator T() +{ + printf("Hello, world.\n"); + return T(); +} + +int main() +{ + S s; + + int i = s.operator int(); +} |