else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE
&& vector_types_convertible_p (from, to, false))
return build_conv (ck_std, to, conv);
- /* A derived-to-base conversion sequence is a user-defined conversion
- because it involves a constructor call, even though it has the rank of
- a standard conversion, so we don't consider it if we aren't allowing
- user-defined conversions. But if we're binding directly to a
- reference, it's only a pointer conversion. */
- else if ((!(flags & LOOKUP_NO_CONVERSION)
- || (flags & LOOKUP_NO_TEMP_BIND))
- && IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
+ else if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
&& is_properly_derived_from (from, to))
{
if (conv->kind == ck_rvalue)
if (overloaded_p)
*overloaded_p = true;
- result = build_over_call (cand, LOOKUP_NORMAL);
+ if (resolve_args (arglist) == error_mark_node)
+ result = error_mark_node;
+ else
+ result = build_over_call (cand, LOOKUP_NORMAL);
}
else
{
about to bind it to a reference, in which case we need to
leave it as an lvalue. */
if (inner >= 0)
- expr = decl_constant_value (expr);
+ {
+ expr = decl_constant_value (expr);
+ if (expr == null_node && INTEGRAL_TYPE_P (totype))
+ /* If __null has been converted to an integer type, we do not
+ want to warn about uses of EXPR as an integer, rather than
+ as a pointer. */
+ expr = build_int_cst (totype, 0);
+ }
return expr;
case ck_ambig:
/* Call build_user_type_conversion again for the error. */
/* Don't make a copy here if build_call is going to. */
if (conv->kind == ck_rvalue
- && !TREE_ADDRESSABLE (complete_type (type)))
+ && COMPLETE_TYPE_P (complete_type (type))
+ && !TREE_ADDRESSABLE (type))
conv = conv->u.next;
val = convert_like_with_context
return build_target_expr_with_type (arg, DECL_CONTEXT (fn));
}
else if (TREE_CODE (arg) == TARGET_EXPR
- || TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn)))
+ || (TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn))
+ && !move_fn_p (fn)))
{
tree to = stabilize_reference
(build_indirect_ref (TREE_VALUE (args), 0));
if (ics1->kind == ck_qual
&& ics2->kind == ck_qual
&& same_type_p (from_type1, from_type2))
- return comp_cv_qual_signature (to_type1, to_type2);
+ {
+ int result = comp_cv_qual_signature (to_type1, to_type2);
+ if (result != 0)
+ return result;
+ }
/* [over.ics.rank]