public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52453] New: compiling error when get address of a virtual function(invalid use of non-static member function)
@ 2012-03-01 16:10 wildpointercs at gmail dot com
  2012-03-01 16:34 ` [Bug c++/52453] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wildpointercs at gmail dot com @ 2012-03-01 16:10 UTC (permalink / raw)
  To: gcc-bugs

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 *)'


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-01 16:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01 16:10 [Bug c++/52453] New: compiling error when get address of a virtual function(invalid use of non-static member function) wildpointercs at gmail dot com
2012-03-01 16:34 ` [Bug c++/52453] " redi at gcc dot gnu.org
2012-03-01 16:40 ` wildpointercs at gmail dot com
2012-03-01 16:43 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).