Re: C++ PATCH for c++/89158 - by-value capture of constexpr variable broken

2019-02-05 Thread Marek Polacek
On Tue, Feb 05, 2019 at 04:17:48PM -0500, Jason Merrill wrote: > On 2/5/19 3:43 PM, Marek Polacek wrote: > > On Tue, Feb 05, 2019 at 01:24:15PM -0500, Jason Merrill wrote: > > > On 2/5/19 11:31 AM, Jakub Jelinek wrote: > > > > On Tue, Feb 05, 2019 at 11:24:14AM -0500, Jason Merrill wrote: > > > > >

Re: C++ PATCH for c++/89158 - by-value capture of constexpr variable broken

2019-02-05 Thread Jason Merrill
On 2/5/19 3:43 PM, Marek Polacek wrote: On Tue, Feb 05, 2019 at 01:24:15PM -0500, Jason Merrill wrote: On 2/5/19 11:31 AM, Jakub Jelinek wrote: On Tue, Feb 05, 2019 at 11:24:14AM -0500, Jason Merrill wrote: Yes, thanks, mark_rvalue_use is definitely wrong here. But mark_lvalue_use might be wr

Re: C++ PATCH for c++/89158 - by-value capture of constexpr variable broken

2019-02-05 Thread Marek Polacek
On Tue, Feb 05, 2019 at 01:24:15PM -0500, Jason Merrill wrote: > On 2/5/19 11:31 AM, Jakub Jelinek wrote: > > On Tue, Feb 05, 2019 at 11:24:14AM -0500, Jason Merrill wrote: > > > Yes, thanks, mark_rvalue_use is definitely wrong here. But > > > mark_lvalue_use > > > might be wrong as well; we don'

Re: C++ PATCH for c++/89158 - by-value capture of constexpr variable broken

2019-02-05 Thread Jason Merrill
On 2/5/19 11:31 AM, Jakub Jelinek wrote: On Tue, Feb 05, 2019 at 11:24:14AM -0500, Jason Merrill wrote: Yes, thanks, mark_rvalue_use is definitely wrong here. But mark_lvalue_use might be wrong as well; we don't know here how the expression is used by the inner conversions for the user-defined

Re: C++ PATCH for c++/89158 - by-value capture of constexpr variable broken

2019-02-05 Thread Jakub Jelinek
On Tue, Feb 05, 2019 at 11:24:14AM -0500, Jason Merrill wrote: > Yes, thanks, mark_rvalue_use is definitely wrong here. But mark_lvalue_use > might be wrong as well; we don't know here how the expression is used by the > inner conversions for the user-defined conversion. Can we remove the call >

Re: C++ PATCH for c++/89158 - by-value capture of constexpr variable broken

2019-02-05 Thread Jason Merrill
On 2/4/19 3:48 PM, Marek Polacek wrote: In this test we have a user-defined conversion converting const int & to T, and we're binding a const int to const int & -- the parameter of the converting ctor. We call Func with "VIEW_CONVERT_EXPR(Val)" as an argument. I like to use a diagram for the co

C++ PATCH for c++/89158 - by-value capture of constexpr variable broken

2019-02-04 Thread Marek Polacek
In this test we have a user-defined conversion converting const int & to T, and we're binding a const int to const int & -- the parameter of the converting ctor. We call Func with "VIEW_CONVERT_EXPR(Val)" as an argument. I like to use a diagram for the conversion like this: ck_rvalue <- ck_u