This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8171: pointers to member functions comparison
- From: Jozef Kosoru <zyzstar at ibl dot sk>
- To: gcc-gnats at gcc dot gnu dot org
- Date: 8 Oct 2002 18:03:51 -0000
- Subject: c++/8171: pointers to member functions comparison
- Reply-to: Jozef Kosoru <zyzstar at ibl dot sk>
>Number: 8171
>Category: c++
>Synopsis: pointers to member functions comparison
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Oct 08 11:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Jozef Kosoru <zyzstar@ibl.sk>
>Release: 3.1.1
>Organization:
>Environment:
Mandrake Linux
>Description:
g++ is not able to compile the following code:
----------------------------------------------------
#include <iostream>
using namespace std;
struct A
{
int f() {}
};
struct B : A
{
};
int main()
{
int (A::*pa)() = &A::f;
int (B::*pb)() = &B::f;
cout << boolalpha << (pa == pb) << endl;
}
----------------------------------------------------
...but according to ISO (see 5.10/2) this code should compile and result of the pointer comparsion would be 'true'.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: