diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-10-19 20:08:23 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-10-19 16:08:23 -0400 |
commit | 51924768e7b22cfc001c93ae562c4ce7c2af60ee (patch) | |
tree | a80a7239efe1c828f5d785068f86b4c524aee0ee /gcc/cp/cvt.c | |
parent | 4f2905fb4b3857320f2a3218f8419d8b3616ce63 (diff) | |
download | gcc-51924768e7b22cfc001c93ae562c4ce7c2af60ee.zip gcc-51924768e7b22cfc001c93ae562c4ce7c2af60ee.tar.gz gcc-51924768e7b22cfc001c93ae562c4ce7c2af60ee.tar.bz2 |
Revamp references to member functions.
* method.c (hack_identifier): Call build_component_ref for a
reference to a member function.
* typeck.c (build_component_ref): Only return a single function
if it's static. Otherwise, return a COMPONENT_REF.
(build_x_function_call): Handle a COMPONENT_REF.
(build_unary_op): Handle all unknown-type things.
* decl2.c (arg_assoc): Handle COMPONENT_REF.
* class.c (instantiate_type): Complain if the function we get is a
nonstatic member function. Remove code for finding "compatible"
functions.
* pt.c (tsubst_copy): Handle NOP_EXPR.
* tree.c (build_dummy_object): New fn.
(maybe_dummy_object): New fn.
(is_dummy_object): New fn.
* cp-tree.h: Declare them.
* cvt.c (cp_convert_to_pointer): Use maybe_dummy_object.
* error.c (dump_expr, case OFFSET_REF): Use is_dummy_object.
* init.c (build_member_call): Use maybe_dummy_object and
is_dummy_object.
(build_offset_ref): Use maybe_dummy_object.
(resolve_offset_ref): Use is_dummy_object.
* typeck.c (build_x_function_call): Call build_dummy_object.
(unary_complex_lvalue): Call is_dummy_object.
* typeck.c (build_component_addr): Make sure field is a field.
* call.c (build_new_op): Delete obsolete code.
* pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args.
From-SVN: r23186
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index a228e27..3058641 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -107,21 +107,8 @@ cp_convert_to_pointer (type, expr) functions. */ if (TYPE_PTRMEMFUNC_P (intype)) { - tree decl, basebinfo; tree fntype = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (intype)); - tree t = TYPE_METHOD_BASETYPE (fntype); - - if (current_class_type == 0 - || get_base_distance (t, current_class_type, 0, &basebinfo) - == -1) - { - decl = build1 (NOP_EXPR, t, error_mark_node); - } - else if (current_class_ptr == 0) - decl = build1 (NOP_EXPR, t, error_mark_node); - else - decl = current_class_ref; - + tree decl = maybe_dummy_object (TYPE_METHOD_BASETYPE (fntype), 0); expr = build (OFFSET_REF, fntype, decl, expr); } |