[Bug c++/22369] New: C++ produces mis-matched types with pointers to member functions

View: New views
3 Messages — Rating Filter:   Alert me  

[Bug c++/22369] New: C++ produces mis-matched types with pointers to member functions

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Testcase:
struct A { void f() { } };
struct B: public A { };

typedef void (B::*bp)();

int main()
{
  bp b = &A::f;
}

--
           Summary: C++ produces mis-matched types with pointers to member
                    functions
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 22368
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22369

[Bug c++/22369] C++ produces mis-matched types with pointers to member functions

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-08 16:30 -------
Oh, I copied the wrong testcase.
Anyways here is the testcase which fails:
struct A { void f() { } };
struct B: public A { };
struct C: public A { };
struct D : public B, public C { };

typedef void (C::*cp)();
typedef void (D::*dp)();

int main()
{
  cp c;
  dp d2 = c;
}
pmf6.C:12: error: statement types mismatch
d2D.1741.__pfnD.1734 = D.1742;

DD.1726:: *
CD.1724:: *

--


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22369

[Bug c++/22369] C++ produces mis-matched types with pointers to member functions

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-05 04:46 -------
Confirmed.

--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-05 04:46:23
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22369