Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.jason/template34.C

raw
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 };
9
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;
15 }
16
17 template<class T>
18 typename Set<T>::Compare Set<T>::cmp1 = &gen_cmp;
19
20 template<class T>
21 int (*Set<T>::cmp2)(const T&, const T&) = &gen_cmp;
22
23 int main() {
24 Set<int> s;
25 }