diff options
author | Jason Merrill <jason@redhat.com> | 2010-05-19 17:02:27 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-05-19 17:02:27 -0400 |
commit | a3360e778c64ee78b08272b4474d0d707061a1c1 (patch) | |
tree | d2b59673b254491d2a8bacc1360f3025eb0c68ad /gcc/cp/call.c | |
parent | a0685b7311e693f8b0ed709ae0727af294a6a72b (diff) | |
download | gcc-a3360e778c64ee78b08272b4474d0d707061a1c1.zip gcc-a3360e778c64ee78b08272b4474d0d707061a1c1.tar.gz gcc-a3360e778c64ee78b08272b4474d0d707061a1c1.tar.bz2 |
call.c (reference_binding): Use cp_build_qualified_type_real and cp_type_quals consistently.
* call.c (reference_binding): Use cp_build_qualified_type_real
and cp_type_quals consistently.
(add_function_candidate): Likewise.
(build_conditional_expr): Likewise.
(convert_like_real): Likewise.
(type_passed_as): Likewise.
* class.c (add_method): Likewise.
(same_signature_p): Likewise.
(layout_class_type): Likewise.
* decl.c (cxx_init_decl_processing): Likewise.
(cp_fname_init): Likewise.
(grokdeclarator): Likewise.
* decl2.c (cp_reconstruct_complex_type): Likewise.
* init.c (build_new_1): Likewise.
* method.c (do_build_copy_constructor): Likewise.
(implicitly_declare_fn): Likewise.
* pt.c (tsubst_aggr_type): Likewise.
(tsubst): Likewise.
* rtti.c (init_rtti_processing): Likewise.
(build_headof): Likewise.
(build_dynamic_cast_1): Likewise.
(tinfo_base_init): Likewise.
(emit_support_tinfos): Likewise.
* semantics.c (capture_decltype): Likewise.
* tree.c (cv_unqualified): Likewise.
* typeck.c (composite_pointer_type): Likewise.
(string_conv_p): Likewise.
* mangle.c (write_CV_qualifiers_for_type): Tweak.
* call.c (initialize_reference): Use CP_TYPE_CONST_P.
* decl.c (start_decl): Likewise.
* semantics.c (finish_compound_literal): Likewise.
* typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
(cp_type_readonly): Remove.
* cp-tree.h: Remove declaration.
From-SVN: r159599
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 97a196b..3cb30a5 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1246,7 +1246,7 @@ reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags) type, so that we can later do a const_cast to the desired type. */ if (related_p && c_cast_p && !at_least_as_qualified_p (to, tfrom)) - to = build_qualified_type (to, cp_type_quals (tfrom)); + to = cp_build_qualified_type (to, cp_type_quals (tfrom)); compatible_p = reference_compatible_p (to, tfrom); /* Directly bind reference when target expression's type is compatible with @@ -1617,9 +1617,8 @@ add_function_candidate (struct z_candidate **candidates, parameter, we can just change the parm type. */ if (ctype && is_this) { - parmtype - = build_qualified_type (ctype, - TYPE_QUALS (TREE_TYPE (parmtype))); + parmtype = cp_build_qualified_type + (ctype, cp_type_quals (TREE_TYPE (parmtype))); parmtype = build_pointer_type (parmtype); } @@ -3777,11 +3776,11 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3, the type of the other. */ if ((conv2 || conv3) && CLASS_TYPE_P (arg2_type) - && TYPE_QUALS (arg2_type) != TYPE_QUALS (arg3_type)) + && cp_type_quals (arg2_type) != cp_type_quals (arg3_type)) arg2_type = arg3_type = cp_build_qualified_type (arg2_type, - TYPE_QUALS (arg2_type) - | TYPE_QUALS (arg3_type)); + cp_type_quals (arg2_type) + | cp_type_quals (arg3_type)); } /* [expr.cond] @@ -4997,7 +4996,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, } /* Build up the array. */ elttype = cp_build_qualified_type - (elttype, TYPE_QUALS (elttype) | TYPE_QUAL_CONST); + (elttype, cp_type_quals (elttype) | TYPE_QUAL_CONST); array = build_array_of_n_type (elttype, len); array = finish_compound_literal (array, new_ctor); @@ -5378,7 +5377,7 @@ type_passed_as (tree type) { type = build_reference_type (type); /* There are no other pointers to this temporary. */ - type = build_qualified_type (type, TYPE_QUAL_RESTRICT); + type = cp_build_qualified_type (type, TYPE_QUAL_RESTRICT); } else if (targetm.calls.promote_prototypes (type) && INTEGRAL_TYPE_P (type) @@ -7735,7 +7734,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup, { if (complain & tf_error) { - if (!(TYPE_QUALS (TREE_TYPE (type)) & TYPE_QUAL_CONST) + if (!CP_TYPE_CONST_P (TREE_TYPE (type)) && !TYPE_REF_IS_RVALUE (type) && !real_lvalue_p (expr)) error ("invalid initialization of non-const reference of " |