The class function sum is expecting as first argument a pointer to a global function, not a pointer to a class function.
Here is the version of sum() which receives a pointer to a test class function :
class test
{
public:
double sum( double ([color=FF9900]test::[/color]*g)(int m),int n);
};