OSDN Git Service

expand
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Jun 2000 02:02:19 +0000 (02:02 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Jun 2000 02:02:19 +0000 (02:02 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34385 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/g++.old-deja/g++.pt/memtemp96.C

index caeceea..66e9a44 100644 (file)
@@ -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; }