2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / template34.C
blobeaeb4641a8577596ca0795c57eec4d52ca835fe4
1 // { dg-do run  }
2 template<class T>
3 class Set {
4   public:
5     typedef int (*Compare)(const T&, const T&);
6     static Compare cmp1;
7     static int (*cmp2)(const T&, const T&);
8 };
10 template<class T>
11 int gen_cmp(const T& a, const T& b) {
12     if (a<b) return -1;
13     else if (a==b) return 0;
14     else return 1;
17 template<class T>
18 typename Set<T>::Compare Set<T>::cmp1 = &gen_cmp;
20 template<class T>
21 int (*Set<T>::cmp2)(const T&, const T&) = &gen_cmp;
23 int main() {
24     Set<int> s;