FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / template43.C
blobd9b3f85fc3ae95080e71a6ac481d1400546e8a66
1 // Test matching of partial specializations.
3 template <int* x, int* y>
4 class EQUAL {
5 public:
6         enum { value = 0 };
7 };
8 template <int* x>
9 class EQUAL<x,x> {
10 public:
11         enum { value = 1 };
14 int x;
15 int y;
17 int equals_x_x = EQUAL<&x,&x>::value; // expected value: 1
18 int equals_x_y = EQUAL<&x,&y>::value; // expected value: 0
19 int equals_y_x = EQUAL<&y,&x>::value; // expected value: 0
20 int equals_y_y = EQUAL<&y,&y>::value; // expected value: 1
22 int main ()
24   if (equals_x_x == 1
25       && equals_x_y == 0
26       && equals_y_x == 0
27       && equals_y_y == 1)
28     return 0;
29   return 1;