diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-29 20:29:26 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-29 20:29:26 +0000 |
commit | c21c015bf4c35f3f6fbaff0944a9260c92238870 (patch) | |
tree | 9cb10a80ad3e11c0cfaafc6f3b7ba397b73dd690 /gcc/cp/cvt.c | |
parent | 07850d167a92588ede252d582306ad441417ae42 (diff) | |
download | gcc-c21c015bf4c35f3f6fbaff0944a9260c92238870.tar.gz |
2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
(build_op_call_1): Likewise.
(build_over_call): Likewise.
(compare_ics): Likewise.
* class.c (build_base_path): Likewise.
(resolve_address_of_overloaded_function): Likewise.
* cp-tree.h: Likewise.
* cvt.c (cp_convert_to_pointer): Likewise.
(convert_to_reference): Likewise.
(ocp_convert): Likewise.
(convert_force): Likewise, tidy.
* cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
(pp_cxx_ptr_operator): Likewise.
* decl.c (duplicate_decls): Likewise.
(start_decl): Likewise.
(grok_op_properties): Likewise.
(start_preparsed_function): Likewise.
(store_parm_decls): Likewise.
(finish_function): Likewise.
* decl2.c (delete_sanity): Likewise.
(acceptable_java_type): Likewise.
(grokbitfield): Likewise.
(cp_reconstruct_complex_type): Likewise.
* error.c (dump_type_prefix): Likewise.
(dump_expr): Likewise.
* except.c (push_eh_cleanup): Likewise.
(complete_ptr_ref_or_void_ptr_p): Likewise.
(can_convert_eh): Likewise.
* init.c (build_new_1): Likewise.
(build_delete): Likewise.
(build_vec_delete): Likewise.
* mangle.c (write_type): Likewise.
* parser.c (lookup_literal_operator): Likewise.
* pt.c (convert_nontype_argument_function): Likewise.
(convert_nontype_argument): Likewise.
(tsubst): Likewise.
(unify): Likewise.
(dependent_type_p_r): Likewise.
* rtti.c (build_headof): Likewise.
(build_typeid): Likewise.
(build_dynamic_cast_1): Likewise.
(target_incomplete_p): Likewise.
(typeinfo_in_lib_p): Likewise.
* semantics.c (finish_omp_for): Likewise.
(cxx_eval_call_expression): Likewise.
(maybe_resolve_dummy): Likewise.
* tree.c (build_target_expr): Likewise.
(cp_build_qualified_type_real): Likewise.
* typeck.c (composite_pointer_type_r): Likewise.
(composite_pointer_type): Likewise.
(comp_except_types): Likewise.
(cxx_sizeof_nowarn): Likewise.
(string_conv_p): Likewise.
(cp_build_array_ref): Likewise.
(cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
(pointer_diff): Likewise.
(cp_build_addr_expr_1): Likewise.
(cp_build_unary_op): Likewise.
(build_static_cast_1): Likewise.
(cp_build_c_cast): Likewise.
(comp_ptr_ttypes_real): Likewise.
(ptr_reasonably_similar): Likewise.
(comp_ptr_ttypes_const): Likewise.
(casts_away_constness): Likewise.
(check_literal_operator_args): Likewise.
* typeck2.c (build_x_arrow): Likewise.
(add_exception_specifier): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197249 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 2cb858b91e0..866396c5b40 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -105,14 +105,14 @@ cp_convert_to_pointer (tree type, tree expr, tsubst_flags_t complain) } /* Handle anachronistic conversions from (::*)() to cv void* or (*)(). */ - if (TREE_CODE (type) == POINTER_TYPE + if (TYPE_PTR_P (type) && (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE || VOID_TYPE_P (TREE_TYPE (type)))) { if (TYPE_PTRMEMFUNC_P (intype) || TREE_CODE (intype) == METHOD_TYPE) return convert_member_func_to_ptr (type, expr, complain); - if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE) + if (TYPE_PTR_P (TREE_TYPE (expr))) return build_nop (type, expr); intype = TREE_TYPE (expr); } @@ -127,7 +127,7 @@ cp_convert_to_pointer (tree type, tree expr, tsubst_flags_t complain) intype = TYPE_MAIN_VARIANT (intype); if (TYPE_MAIN_VARIANT (type) != intype - && TREE_CODE (type) == POINTER_TYPE + && TYPE_PTR_P (type) && TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE && MAYBE_CLASS_TYPE_P (TREE_TYPE (type)) && MAYBE_CLASS_TYPE_P (TREE_TYPE (intype)) @@ -483,7 +483,7 @@ convert_to_reference (tree reftype, tree expr, int convtype, /* B* bp; A& ar = (A&)bp; is valid, but it's probably not what they meant. */ if ((complain & tf_warning) - && TREE_CODE (intype) == POINTER_TYPE + && TYPE_PTR_P (intype) && (comptypes (TREE_TYPE (intype), type, COMPARE_BASE | COMPARE_DERIVED))) warning_at (loc, 0, "casting %qT to %qT does not dereference pointer", @@ -723,7 +723,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags, if (((INTEGRAL_OR_ENUMERATION_TYPE_P (intype) || TREE_CODE (intype) == REAL_TYPE) && ! (convtype & CONV_STATIC)) - || TREE_CODE (intype) == POINTER_TYPE) + || TYPE_PTR_P (intype)) { if (complain & tf_error) permerror (loc, "conversion from %q#T to %q#T", intype, type); @@ -758,7 +758,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags, } if (code == BOOLEAN_TYPE) { - if (TREE_CODE (intype) == VOID_TYPE) + if (VOID_TYPE_P (intype)) { if (complain & tf_error) error_at (loc, @@ -1457,8 +1457,7 @@ convert_force (tree type, tree expr, int convtype, tsubst_flags_t complain) complain)); /* From typeck.c convert_for_assignment */ - if (((TREE_CODE (TREE_TYPE (e)) == POINTER_TYPE && TREE_CODE (e) == ADDR_EXPR - && TREE_CODE (TREE_TYPE (e)) == POINTER_TYPE + if (((TYPE_PTR_P (TREE_TYPE (e)) && TREE_CODE (e) == ADDR_EXPR && TREE_CODE (TREE_TYPE (TREE_TYPE (e))) == METHOD_TYPE) || integer_zerop (e) || TYPE_PTRMEMFUNC_P (TREE_TYPE (e))) |