http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52453
Bug #: 52453
Summary: compiling error when get address of a virtual
function(invalid use of non-static member function)
Classification: Unclassified
Product: gcc
Version: 4.2.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
Version:gcc4.2.4,
System :Ubuntu Linux 2.6.24
The preprocessed file:
# 1 "test.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.cpp"
class Test
{
public:
virtual void func(char *p){}
};
int main()
{
typedef void (Test::*pTestfunc)(char *);
pTestfunc pf = &(Test::func); // error here.
}
Error message: invalid use of non-static member function 'virtual void
Test::func(char *)'