diff options
author | Jason Merrill <jason@gcc.gnu.org> | 1998-01-28 05:58:52 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-01-28 05:58:52 -0500 |
commit | fca482568a40e38c9c95938128bc01c473b9587f (patch) | |
tree | 737d3707d59794167508c8ad05886c4654f2796f /gcc | |
parent | fb0390de12d7d4c9dc17eb0b3c79dec9dff87137 (diff) | |
download | gcc-fca482568a40e38c9c95938128bc01c473b9587f.zip gcc-fca482568a40e38c9c95938128bc01c473b9587f.tar.gz gcc-fca482568a40e38c9c95938128bc01c473b9587f.tar.bz2 |
new
From-SVN: r17530
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/explicit20.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/explicit22.C | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/local3.C | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/memtemp18.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/spec12.C | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/spec13.C | 42 |
7 files changed, 95 insertions, 7 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit20.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit20.C index 487d263..918ff3a 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit20.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit20.C @@ -4,4 +4,4 @@ template <class T> T foo(T t); template <> -int foo<char>(char c); // ERROR - bad return type. +int foo<char>(char c); // ERROR - does not match any template declaration diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit22.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit22.C index a012094..2cb2338 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit22.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit22.C @@ -1,10 +1,10 @@ // Build don't link: // GROUPS passed templates template <class T, class U> -T foo(T t, U* u); +T foo(T t, U* u); // ERROR - template candidate template <class T> -T foo(T t, T* t); +T foo(T t, T* t); // ERROR - template candidate template <> -int foo<int>(int, int*); // ERROR - ambiguous specialization. +int foo<int>(int, int*); // ERROR - ambiguous template specialization diff --git a/gcc/testsuite/g++.old-deja/g++.pt/local3.C b/gcc/testsuite/g++.old-deja/g++.pt/local3.C index 58c2627..ea1b386 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/local3.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/local3.C @@ -3,15 +3,19 @@ extern "C" void abort(); template <class T> void f(T) { + int j; + + j = 6; + struct S { int i; }; S s; - s.i = 3; + s.i = j; - if (s.i != 3) + if (s.i != 6) abort(); } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp18.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp18.C index c9b76c3..638e5e3 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp18.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp18.C @@ -3,7 +3,7 @@ struct S { template <class T> - void foo(T); + void foo(T) {} }; template void S::foo(int); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C new file mode 100644 index 0000000..6185d3d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C @@ -0,0 +1,21 @@ +// Build don't link: + +template <class T> +struct S1 {}; + +template <class T> +void f(T); + +template <class C> +struct S2 +{ + template <class T> + void f<S1<T> >(T) {} // ERROR - bad specialization. +}; + + +template <class T> +struct S3 +{ + friend class S2<T>; +}; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec12.C b/gcc/testsuite/g++.old-deja/g++.pt/spec12.C new file mode 100644 index 0000000..71676ff --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/spec12.C @@ -0,0 +1,21 @@ +extern "C" void abort(); + +template <class T> +struct S +{ + template <class U> + int f(U u); +}; + + +template <class T> +template <> +int S<T>::f<int>(int i) { return 1; } + +int main() +{ + S<char> sc; + + if (sc.f(3) != 1) + abort(); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec13.C b/gcc/testsuite/g++.old-deja/g++.pt/spec13.C new file mode 100644 index 0000000..8f94570 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/spec13.C @@ -0,0 +1,42 @@ +template <class T> +void f(T t); + +template <class T> +void f(T* t); + +template <> +void f(int* ip) {} + +struct S1 +{ + template <class T> + void f(T t); + + template <class T> + void f(T* t); + + template <> + void f(int* ip) {} +}; + +template <class U> +struct S2 +{ + template <class T> + void f(T t); + + template <class T> + void f(T* t); + + template <> + void f(int* ip) {} +}; + +int main() +{ + int* ip; + S1 s1; + s1.f(ip); + S2<double> s2; + s2.f(ip); +} |