diff options
author | Mark Mitchell <mark@markmitchell.com> | 1998-11-01 15:45:11 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-11-01 15:45:11 +0000 |
commit | 3bfdc7190fb8136f0f66108e43f49b0b28e98374 (patch) | |
tree | 98a820a83d25e681e25774f57c392cb655a13b62 /gcc/cp/cvt.c | |
parent | 6d8cf409b45c2b7994fd0e8ce9f235b984298e07 (diff) | |
download | gcc-3bfdc7190fb8136f0f66108e43f49b0b28e98374.zip gcc-3bfdc7190fb8136f0f66108e43f49b0b28e98374.tar.gz gcc-3bfdc7190fb8136f0f66108e43f49b0b28e98374.tar.bz2 |
cp-tree.h (COMPARE_STRICT): New macro.
* cp-tree.h (COMPARE_STRICT): New macro.
(COMPARE_BASE): Likewise.
(COMPARE_RELAXED): Likewise.
(COMPARE_REDECLARATION): Likewise.
(same_type_p): Likewise.
(same_or_base_type_p): Likewise.
* call.c (standard_conversion): Use them, in place of comptypes
with numeric arguments.
(reference_binding): Likewise.
(convert_like): Likewise.
(build_over_call): Likewise.
(is_subseq): Likewise.
(is_properly_derived_from): Likewise.
(compare_ics): Likewise.
(joust): Likewise.
* class.c (delete_duplicate_fields_1): Likewise.
(resolves_to_fixed_type_p): Likewise.
(instantiate_type): Likewise. Remove #if 0'd code.
* decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here.
(pushdecl): Likewise.
(lookup_name_real): Likewise.
(grokdeclarator): Likewise. Check for illegal array declarations.
(grokparms): Likewise.
(grok_op_properties): Likewise.
* decl2.c (check_classfn): Likewise.
* friend.c (is_friend): Likewise.
(make_friend_class): Likewise.
* init.c (expand_aggr_init): Likewise.
(expand_vec_init): Likewise.
* pt.c (is_member_template_class): Remove declaration.
(is_specialization_of): Use COMPARE_* and new macros.
(comp_template_parms): Likewise.
(convert_nontype_argument): Likewise.
(coerce_template_template_parms): Likewise.
(template_args_equal): Likewise.
(lookup_template_class): Likewise.
(type_unification_real): Likewise.
(unify): Likewise.
(get_bindings_real): Likewise.
* search.c (covariant_return_p): Likewise.
(get_matching_virtual): Likewise.
* sig.c (match_method_types): Likewise.
* tree.c (vec_binfo_member): Likewise.
(cp_tree_equal): Likewise.
* typeck.c (common_type): Likewise.
(comp_array_types): Likewise. Get issues involving unknown array
bounds right.
(comptypes): Update comments. Use new flags.
(comp_target_types): Use new macros.
(compparms): Likewise.
(comp_target_parms): Likewise.
(string_conv_p): Likewise.
(build_component_ref): Likewise.
(build_indirect_ref): Likewise.
(build_conditional_expr): Likewise.
(build_static_cast): Likewise.
(build_reinterpret_cast): Likewise.
(build_const_cast): Likewise.
(build_modify_expr): Likewise.
(convert_for_assignment): Likewise.
(comp_ptr_ttypes_real): Likewise.
(ptr_reasonably_similar): Likewise.
(comp_ptr_ttypes_const): Likewise.
From-SVN: r23490
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 30fb334..84d3c67 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -487,7 +487,8 @@ convert_to_reference (reftype, expr, convtype, flags, decl) /* B* bp; A& ar = (A&)bp; is valid, but it's probably not what they meant. */ if (TREE_CODE (intype) == POINTER_TYPE - && (comptypes (TREE_TYPE (intype), type, -1))) + && (comptypes (TREE_TYPE (intype), type, + COMPARE_BASE | COMPARE_RELAXED ))) cp_warning ("casting `%T' to `%T' does not dereference pointer", intype, reftype); @@ -669,7 +670,7 @@ ocp_convert (type, expr, convtype, flags) /* We need a new temporary; don't take this shortcut. */; else if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (e))) { - if (comptypes (type, TREE_TYPE (e), 1)) + if (same_type_p (type, TREE_TYPE (e))) /* The call to fold will not always remove the NOP_EXPR as might be expected, since if one of the types is a typedef; the comparsion in fold is just equality of pointers, not a |