Re: [C++ PATCH] Fix xvalue COND_EXPR handling (PR c++/88103)

2018-12-03 Thread Jason Merrill
On Mon, Dec 3, 2018 at 4:36 PM Jakub Jelinek wrote: > > On Mon, Dec 03, 2018 at 02:44:32PM -0500, Jason Merrill wrote: > > > > Is there a reason not to use the 'move' function here? > > > > > > That doesn't work at all. move doesn't call cp_convert, but > > > build_static_cast (though for the

Re: [C++ PATCH] Fix xvalue COND_EXPR handling (PR c++/88103)

2018-12-03 Thread Jakub Jelinek
On Mon, Dec 03, 2018 at 02:44:32PM -0500, Jason Merrill wrote: > > > Is there a reason not to use the 'move' function here? > > > > That doesn't work at all. move doesn't call cp_convert, but > > build_static_cast (though for the same reference && type). > > But while cp_convert only adds

Re: [C++ PATCH] Fix xvalue COND_EXPR handling (PR c++/88103)

2018-12-03 Thread Jason Merrill
On 12/2/18 8:07 AM, Jakub Jelinek wrote: On Sat, Dec 01, 2018 at 07:11:08PM -0500, Jason Merrill wrote: On the following testcase, build_conditional_expr_1 tries hard to make sure that if both arguments are xvalue_p (or one is and the other throw) the result is still xvalue_p. But, later on we

Re: [C++ PATCH] Fix xvalue COND_EXPR handling (PR c++/88103)

2018-12-02 Thread Jakub Jelinek
On Sat, Dec 01, 2018 at 07:11:08PM -0500, Jason Merrill wrote: > > On the following testcase, build_conditional_expr_1 tries hard to make sure > > that if both arguments are xvalue_p (or one is and the other throw) the > > result is still xvalue_p. But, later on we call unary_complex_lvalue, > >

Re: [C++ PATCH] Fix xvalue COND_EXPR handling (PR c++/88103)

2018-12-01 Thread Jason Merrill
On 11/29/18 4:52 PM, Jakub Jelinek wrote: Hi! On the following testcase, build_conditional_expr_1 tries hard to make sure that if both arguments are xvalue_p (or one is and the other throw) the result is still xvalue_p. But, later on we call unary_complex_lvalue, which does

[C++ PATCH] Fix xvalue COND_EXPR handling (PR c++/88103)

2018-11-29 Thread Jakub Jelinek
Hi! On the following testcase, build_conditional_expr_1 tries hard to make sure that if both arguments are xvalue_p (or one is and the other throw) the result is still xvalue_p. But, later on we call unary_complex_lvalue, which does rationalize_conditional_expr which changes it from cond ? x : y