aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-06-03 22:02:19 -0400
committerJason Merrill <jason@gcc.gnu.org>2000-06-03 22:02:19 -0400
commit7a50d89174fd0dfee1a44807234d3fce13a72f89 (patch)
tree231f3f89a65fbf76aa012843c6ea185ad4dbecb9 /gcc
parentf9a7ae04e9619a0f1255ca922ca5b8e2db417bd7 (diff)
downloadgcc-7a50d89174fd0dfee1a44807234d3fce13a72f89.zip
gcc-7a50d89174fd0dfee1a44807234d3fce13a72f89.tar.gz
gcc-7a50d89174fd0dfee1a44807234d3fce13a72f89.tar.bz2
expand
From-SVN: r34385
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp96.C28
1 files changed, 22 insertions, 6 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp96.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp96.C
index caeceea..66e9a44 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp96.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp96.C
@@ -1,17 +1,33 @@
-// Build don't link:
+// Test for partial specialization of a member function template.
// Origin: Jason Merrill <jason@cygnus.com>
template <class T> struct A {
- template <class U> void f(U);
+ template <class U> int f(U) { return 42; }
};
template <>
template <class U>
-void A<int>::f(U);
+int A<char>::f(U);
-A<int> a;
+template <>
+template <class U>
+int A<double>::f(U) { return 24; }
-void g ()
+int main ()
{
- a.f (3);
+ A<int> ai;
+ if (ai.f(0) != 42)
+ return 1;
+
+ A<double> ad;
+ if (ad.f(0) != 24)
+ return 1;
+
+ A<char> ac;
+ if (ac.f(0) != 36)
+ return 1;
}
+
+template <>
+template <class U>
+int A<char>::f(U) { return 36; }