case ck_rvalue:
expr = decay_conversion (expr, complain);
if (expr == error_mark_node)
- return error_mark_node;
+ {
+ if (complain)
+ {
+ maybe_print_user_conv_context (convs);
+ if (fn)
+ inform (DECL_SOURCE_LOCATION (fn),
+ " initializing argument %P of %qD", argnum, fn);
+ }
+ return error_mark_node;
+ }
if (! MAYBE_CLASS_TYPE_P (totype))
return expr;
/* Perform the conversions in [expr] that apply when an lvalue appears
in an rvalue context: the lvalue-to-rvalue, array-to-pointer, and
- function-to-pointer conversions. In addition, manifest constants
- are replaced by their values, and bitfield references are converted
- to their declared types. Note that this function does not perform the
- lvalue-to-rvalue conversion for class types. If you need that conversion
- to for class types, then you probably need to use force_rvalue.
+ function-to-pointer conversions. In addition, bitfield references are
+ converted to their declared types. Note that this function does not perform
+ the lvalue-to-rvalue conversion for class types. If you need that conversion
+ for class types, then you probably need to use force_rvalue.
Although the returned value is being used as an rvalue, this
function does not wrap the returned expression in a
if (type == error_mark_node)
return error_mark_node;
- exp = mark_rvalue_use (exp, loc, reject_builtin);
-
exp = resolve_nondeduced_context (exp);
if (type_unknown_p (exp))
{
if (invalid_nonstatic_memfn_p (loc, exp, complain))
return error_mark_node;
if (code == FUNCTION_TYPE || is_overloaded_fn (exp))
- return cp_build_addr_expr (exp, complain);
+ {
+ exp = mark_lvalue_use (exp);
+ if (reject_builtin && reject_gcc_builtin (exp, loc))
+ return error_mark_node;
+ return cp_build_addr_expr (exp, complain);
+ }
if (code == ARRAY_TYPE)
{
tree adr;
tree ptrtype;
+ exp = mark_lvalue_use (exp);
+
if (INDIRECT_REF_P (exp))
return build_nop (build_pointer_type (TREE_TYPE (type)),
TREE_OPERAND (exp, 0));
return cp_convert (ptrtype, adr, complain);
}
+ /* Otherwise, it's the lvalue-to-rvalue conversion. */
+ exp = mark_rvalue_use (exp, loc, reject_builtin);
+
/* If a bitfield is used in a context where integral promotion
applies, then the caller is expected to have used
default_conversion. That function promotes bitfields correctly
if (!CLASS_TYPE_P (type) && cv_qualified_p (type))
exp = build_nop (cv_unqualified (type), exp);
+ if (!complete_type_or_maybe_complain (type, exp, complain))
+ return error_mark_node;
+
return exp;
}