repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.mike
/
pmf7.C
blob
bc380dba692229e1d7c875229fe51df61bbad8af
1
// { dg-do run }
2
class A;
3
typedef int (A::*f_ptr) (void);
4
5
class B {
6
public:
7
B() {}; ~B() {};
8
B& dummy(f_ptr cb) { return *this; };
9
};
10
11
template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) {
12
sp->dummy(cb);
13
return *sp;
14
}
15
16
class A {
17
public:
18
A() {}; ~A() {};
19
int ok() { return 0; };
20
A& call_it(B* s) {
21
call_dummy(s, &A::ok);
22
return *this;
23
};
24
};
25
26
int main() {
27
A a; B b;
28
a.call_it(&b);
29
return 0;
30
}