2004-01-16 Mark Mitchell <mark@codesourcery.com>
PR c++/13478
- * call.c (convert_like_real): Do not perform an additional
- direct-initialization when binding to a reference.
+ * call.c (initialize_reference): Pass -1 for inner parameter to
+ convert_like_real.
2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
conversion, but is not considered during overload resolution.
If the target is a class, that means call a ctor. */
- if (IS_AGGR_TYPE (totype) && inner >= 0)
+ if (IS_AGGR_TYPE (totype)
+ && (inner >= 0 || !lvalue_p (expr)))
{
expr = (build_temp
(expr, totype,
else
base_conv_type = NULL_TREE;
/* Perform the remainder of the conversion. */
- expr = convert_like (conv, expr);
+ expr = convert_like_real (conv, expr,
+ /*fn=*/NULL_TREE, /*argnum=*/0,
+ /*inner=*/-1,
+ /*issue_conversion_warnings=*/true);
if (!real_lvalue_p (expr))
{
tree init;