/* Process the initializer for the declaration. */
DECL_INITIAL (arg) = targ;
- cp_finish_decl (arg, targ, NULL_TREE, 0,
+ cp_finish_decl (arg, targ, NULL_TREE,
LOOKUP_ONLYCONVERTING|DIRECT_BIND);
}
else if (!(flags & DIRECT_BIND) && ! lvalue_p (arg))
- {
- tree slot = build_decl (VAR_DECL, NULL_TREE, argtype);
- DECL_ARTIFICIAL (slot) = 1;
- arg = build (TARGET_EXPR, argtype, slot, arg, NULL_TREE, NULL_TREE);
- TREE_SIDE_EFFECTS (arg) = 1;
- }
+ return get_target_expr (arg);
/* If we had a way to wrap this up, and say, if we ever needed it's
address, transform all occurrences of the register, into a memory
|| TREE_TYPE (e) == error_mark_node)
return error_mark_node;
+ complete_type (type);
+ complete_type (TREE_TYPE (expr));
+
if (TREE_READONLY_DECL_P (e))
e = decl_constant_value (e);
}
if (code == BOOLEAN_TYPE)
{
+ tree fn = NULL_TREE;
+
/* Common Ada/Pascal programmer's mistake. We always warn
about this since it is so bad. */
if (TREE_CODE (expr) == FUNCTION_DECL)
- cp_warning ("the address of `%D', will always be `true'", expr);
+ fn = expr;
+ else if (TREE_CODE (expr) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (expr, 0)) == FUNCTION_DECL)
+ fn = TREE_OPERAND (expr, 0);
+ if (fn)
+ cp_warning ("the address of `%D', will always be `true'", fn);
return truthvalue_conversion (e);
}
return fold (convert_to_integer (type, e));