This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52453] New: compiling error when get address of a virtual function(invalid use of non-static member function)
- From: "wildpointercs at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Mar 2012 16:08:51 +0000
- Subject: [Bug c++/52453] New: compiling error when get address of a virtual function(invalid use of non-static member function)
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: wildpointercs@gmail.com
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 *)'