Re: [pushed] c++: constant, array, lambda, template [PR108975]

2023-04-25 Thread Jason Merrill via Gcc-patches
On 4/25/23 10:55, Patrick Palka wrote: On Sat, 18 Mar 2023, Patrick Palka wrote: On Fri, 17 Mar 2023, Jason Merrill via Gcc-patches wrote: Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- When a lambda refers to a constant local variable in the enclosing scope, we tentatively

Re: [pushed] c++: constant, array, lambda, template [PR108975]

2023-04-25 Thread Patrick Palka via Gcc-patches
On Sat, 18 Mar 2023, Patrick Palka wrote: > On Fri, 17 Mar 2023, Jason Merrill via Gcc-patches wrote: > > > Tested x86_64-pc-linux-gnu, applying to trunk. > > > > -- 8< -- > > > > When a lambda refers to a constant local variable in the enclosing scope, we > > tentatively capture it, but if we

Re: [pushed] c++: constant, array, lambda, template [PR108975]

2023-03-18 Thread Patrick Palka via Gcc-patches
On Fri, 17 Mar 2023, Jason Merrill via Gcc-patches wrote: > Tested x86_64-pc-linux-gnu, applying to trunk. > > -- 8< -- > > When a lambda refers to a constant local variable in the enclosing scope, we > tentatively capture it, but if we end up pulling out its constant value, we > go back at the

[pushed] c++: constant, array, lambda, template [PR108975]

2023-03-17 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- When a lambda refers to a constant local variable in the enclosing scope, we tentatively capture it, but if we end up pulling out its constant value, we go back at the end of the lambda and prune any unneeded captures. Here while parsing