Re: C++ PATCH for c++/85889, reject capturing a structured binding

2018-05-30 Thread Marek Polacek
On Wed, May 30, 2018 at 01:33:17AM +0300, Ville Voutilainen wrote: > On 30 May 2018 at 01:23, Jason Merrill wrote: > > On Tue, May 29, 2018 at 4:44 PM, Marek Polacek wrote: > >> [expr.prim.lambda.capture] p8 says "If a lambda-expression explicitly > >> captures > >> an entity that is not odr-usa

Re: C++ PATCH for c++/85889, reject capturing a structured binding

2018-05-29 Thread Ville Voutilainen
On 30 May 2018 at 01:23, Jason Merrill wrote: > On Tue, May 29, 2018 at 4:44 PM, Marek Polacek wrote: >> [expr.prim.lambda.capture] p8 says "If a lambda-expression explicitly >> captures >> an entity that is not odr-usable or captures a structured binding (explicitly >> or implicitly), the progr

Re: C++ PATCH for c++/85889, reject capturing a structured binding

2018-05-29 Thread Jason Merrill
On Tue, May 29, 2018 at 4:44 PM, Marek Polacek wrote: > [expr.prim.lambda.capture] p8 says "If a lambda-expression explicitly captures > an entity that is not odr-usable or captures a structured binding (explicitly > or implicitly), the program is ill-formed." That's a pretty recent change, and s

C++ PATCH for c++/85889, reject capturing a structured binding

2018-05-29 Thread Marek Polacek
[expr.prim.lambda.capture] p8 says "If a lambda-expression explicitly captures an entity that is not odr-usable or captures a structured binding (explicitly or implicitly), the program is ill-formed." but we weren't respecting that and the attached testcase compiled. I think we can reject such use