diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-03-23 00:01:48 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-03-23 00:01:48 +0000 |
commit | e08a8f45f515854210dc47d78e13302536d2fc35 (patch) | |
tree | f11d1b07e9ec203859528a02af06b002e362a896 /gcc/cp/cvt.c | |
parent | edebba7aaef2d4af34267d0a52ebd6f57c5a28b3 (diff) | |
download | gcc-e08a8f45f515854210dc47d78e13302536d2fc35.zip gcc-e08a8f45f515854210dc47d78e13302536d2fc35.tar.gz gcc-e08a8f45f515854210dc47d78e13302536d2fc35.tar.bz2 |
cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
* cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
Document internals of pointer-to-member-functions.
(DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
(PFN_FROM_PTRMEMFUNC): Similarly.
(build_type_conversion): Remove unused parameter.
(build_ptrmemfunc1): Declare.
(expand_ptrmemfunc_cst): New function.
(delta2_from_ptrmemfunc): Likewise.
(pfn_from_ptrmemfunc): Likewise.
* cvt.c (cp_convert_to_pointer): Remove unused parameter to
build_type_conversion. Use TYPE_PTRMEM_P for readability.
(convert_to_reference): Remove unused parameter to
build_type_conversion.
(ocp_convert): Likewise.
(build_user_type_conversion): Likewise.
* error.c (dump_expr): Handle NULL pointer-to-member functions.
* expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
* method.c (build_overload_value): Don't go splitting CONSTRUCTORs
open when handling pointer-to-member functions.
* pt.c (convert_nontype_argument): Clean up error messages. Be
more stringent with pointers-to-members.
* typeck.c (build_ptrmemfunc1): Don't declare. Make it global.
(build_unary_op): Tidy ever-so-slightly.
(build_conditional_expr): Remove extra parameter to
build_type_conversion.
(build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
we're using.
(expand_ptrmemfunc_cst): Define.
(delta2_from_ptrmemfunc): Likewise.
(pfn_from_ptrmemfunc): Likewise.
From-SVN: r25913
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 9f29c65..72721ce 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -85,7 +85,7 @@ cp_convert_to_pointer (type, expr) return error_mark_node; } - rval = build_type_conversion (CONVERT_EXPR, type, expr, 1); + rval = build_type_conversion (type, expr, 1); if (rval) { if (rval == error_mark_node) @@ -177,9 +177,7 @@ cp_convert_to_pointer (type, expr) } } - if (TREE_CODE (type) == POINTER_TYPE - && TREE_CODE (TREE_TYPE (type)) == OFFSET_TYPE - && TREE_CODE (TREE_TYPE (intype)) == OFFSET_TYPE) + if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype)) { tree b1 = TYPE_OFFSET_BASETYPE (TREE_TYPE (type)); tree b2 = TYPE_OFFSET_BASETYPE (TREE_TYPE (intype)); @@ -432,7 +430,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl) /* Look for a user-defined conversion to lvalue that we can use. */ rval_as_conversion - = build_type_conversion (CONVERT_EXPR, reftype, expr, 1); + = build_type_conversion (reftype, expr, 1); if (rval_as_conversion && rval_as_conversion != error_mark_node && real_lvalue_p (rval_as_conversion)) @@ -735,7 +733,7 @@ ocp_convert (type, expr, convtype, flags) if (IS_AGGR_TYPE (intype)) { tree rval; - rval = build_type_conversion (CONVERT_EXPR, type, e, 1); + rval = build_type_conversion (type, e, 1); if (rval) return rval; if (flags & LOOKUP_COMPLAIN) @@ -762,7 +760,7 @@ ocp_convert (type, expr, convtype, flags) if (IS_AGGR_TYPE (TREE_TYPE (e))) { tree rval; - rval = build_type_conversion (CONVERT_EXPR, type, e, 1); + rval = build_type_conversion (type, e, 1); if (rval) return rval; else @@ -948,8 +946,7 @@ convert_force (type, expr, convtype) (jason 8/9/95) */ tree -build_type_conversion (code, xtype, expr, for_sure) - enum tree_code code ATTRIBUTE_UNUSED; +build_type_conversion (xtype, expr, for_sure) tree xtype, expr; int for_sure; { |