This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: fix comparison of C++ pointers to member functions
- From: "Ollie Wild" <aaw at google dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 12 Nov 2007 22:15:07 -0800
- Subject: 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.