Commit 6e9554e1 by Jason Merrill Committed by Jason Merrill

re PR c++/9868 (ICE in c_expand_expr when qualifying member variable)

        PR c++/9868
        * call.c (resolve_scoped_fn_name): Handle the case of a function
        pointer member.

From-SVN: r64122
parent ebb780f2
2003-03-10 Jason Merrill <jason@redhat.com>
PR c++/9868
* call.c (resolve_scoped_fn_name): Handle the case of a function
pointer member.
* decl2.c (build_offset_ref_call_from_tree): Only mess with 'this'
argument in the pointer-to-member case.
2003-03-09 Mark Mitchell <mark@codesourcery.com>
PR c++/9373
......
......@@ -2702,6 +2702,10 @@ resolve_scoped_fn_name (tree scope, tree name)
if (fn && current_class_type)
fn = (adjust_result_of_qualified_name_lookup
(fn, scope, current_class_type));
/* It might be the name of a function pointer member. */
if (fn && TREE_CODE (fn) == FIELD_DECL)
fn = resolve_offset_ref (build_offset_ref (scope, fn));
}
if (!fn)
......
......@@ -3277,15 +3277,16 @@ build_offset_ref_call_from_tree (tree fn, tree args)
/* This code is not really correct (for example, it does not
handle the case that `A::f' is overloaded), but it is
historically how we have handled this situation. */
object_addr = build_unary_op (ADDR_EXPR, TREE_OPERAND (fn, 0), 0);
if (TREE_CODE (TREE_OPERAND (fn, 1)) == FIELD_DECL)
fn = resolve_offset_ref (fn);
/* This case should now be handled elsewhere. */
abort ();
else
{
object_addr = build_unary_op (ADDR_EXPR, TREE_OPERAND (fn, 0), 0);
fn = TREE_OPERAND (fn, 1);
fn = get_member_function_from_ptrfunc (&object_addr, fn);
args = tree_cons (NULL_TREE, object_addr, args);
}
args = tree_cons (NULL_TREE, object_addr, args);
return build_function_call (fn, args);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment