+2013-07-09 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/53000
+ * call.c (build_conditional_expr_1): Preserve xvalues.
+
2013-07-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51786
/* [expr.cond]
- If the second and third operands are lvalues and have the same
- type, the result is of that type and is an lvalue. */
- if (real_lvalue_p (arg2)
- && real_lvalue_p (arg3)
+ If the second and third operands are glvalues of the same value
+ category and have the same type, the result is of that type and
+ value category. */
+ if (((real_lvalue_p (arg2) && real_lvalue_p (arg3))
+ || (xvalue_p (arg2) && xvalue_p (arg3)))
&& same_type_p (arg2_type, arg3_type))
{
result_type = arg2_type;
return 1;
if (strcmp (typeid(g).name(), "FRivE") != 0)
return 2;
- if (strcmp (typeid(h).name(), "FivE") != 0)
+ if (strcmp (typeid(h).name(), "FOivE") != 0)
return 3;
}