Re: [PATCH] c++: empty captured var as template argument [PR107437]

2022-12-16 Thread Jason Merrill via Gcc-patches
On 12/16/22 14:03, Patrick Palka wrote: On Fri, 16 Dec 2022, Jason Merrill wrote: On 12/16/22 11:45, Patrick Palka wrote: Here we're rejecting the use of the captured 't' (of empty type) as a template argument ultimately because convert_nontype_argument checks potentiality using is_constant_ex

Re: [PATCH] c++: empty captured var as template argument [PR107437]

2022-12-16 Thread Patrick Palka via Gcc-patches
On Fri, 16 Dec 2022, Jason Merrill wrote: > On 12/16/22 11:45, Patrick Palka wrote: > > Here we're rejecting the use of the captured 't' (of empty type) as a > > template argument ultimately because convert_nontype_argument checks > > potentiality using is_constant_expression which returns false f

Re: [PATCH] c++: empty captured var as template argument [PR107437]

2022-12-16 Thread Jason Merrill via Gcc-patches
On 12/16/22 11:45, Patrick Palka wrote: Here we're rejecting the use of the captured 't' (of empty type) as a template argument ultimately because convert_nontype_argument checks potentiality using is_constant_expression which returns false for captured variables since want_rval=false. But in th

[PATCH] c++: empty captured var as template argument [PR107437]

2022-12-16 Thread Patrick Palka via Gcc-patches
Here we're rejecting the use of the captured 't' (of empty type) as a template argument ultimately because convert_nontype_argument checks potentiality using is_constant_expression which returns false for captured variables since want_rval=false. But in this case an lvalue-to-rvalue conversion of