This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37016] [4.3/4.4 Regression] member function pointer failure with optimization
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2008 13:41:20 -0000
- Subject: [Bug c++/37016] [4.3/4.4 Regression] member function pointer failure with optimization
- References: <bug-37016-16558@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2008-08-04 13:41 -------
Of course it didn't work. The following seems to
Index: gcc/cp/class.c
===================================================================
--- gcc/cp/class.c (revision 138611)
+++ gcc/cp/class.c (working copy)
@@ -6197,7 +6197,12 @@ resolve_address_of_overloaded_function (
}
if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type))
- return cp_build_unary_op (ADDR_EXPR, fn, 0, flags);
+ {
+ tree tem = cp_build_unary_op (ADDR_EXPR, fn, 0, flags);
+ if (TREE_CODE (tem) == PTRMEM_CST)
+ return make_ptrmem_cst (target_type, fn);
+ return tem;
+ }
else
{
/* The target must be a REFERENCE_TYPE. Above, cp_build_unary_op
we might be able to unconditionally do return make_ptrmem_cst (target_type,
fn);
for TYPE_PTRMEMFUNC_P (target_type) though.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37016