This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: fix comparison of C++ pointers to member functions


Section 5.10 of the C++ standard states:

"In addition, pointers to members can be compared, or a pointer to
member and a null pointer constant.  Pointer to member conversions
(4.11) and qualification conversions (4.4) are performed to bring them
to a common type."

The C++ front end fails to perform the indicated conversions when
comparing pointers to member functions.  This patch rectifies this.

Tested with a C/C++/Java bootstrap and testsuite on i686-pc-linux-gnu.

Ollie

:ADDPATCH c++:

2007-11-12  Ollie Wild  <aaw@google.com>

        * typeck.c (build_binary_op): Add conversion of pointers to member
        functions appearing as operands to the equality operators.

2007-11-12  Ollie Wild  <aaw@google.com>

        * g++.dg/conversion/ptrmem9.C: New test.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]