Re: [C++ PATCH] pr 67273 & 79253 lambdas, warnings & ICEs

2017-01-31 Thread Nathan Sidwell
On 01/31/2017 10:04 AM, Jason Merrill wrote: Agreed. As I was suggesting in response to one of Adam's patches, I think we need to defer creating the closure until f is instantiated; at that point we can resolve all names from f and so we should be able to always push to top when instantiating t

Re: [C++ PATCH] pr 67273 & 79253 lambdas, warnings & ICEs

2017-01-31 Thread Jason Merrill
On Tue, Jan 31, 2017 at 8:31 AM, Nathan Sidwell wrote: > On 01/30/2017 03:48 PM, Jason Merrill wrote: >> Why can't it figure that out for itself? We should be able to tell >> whether its containing function is currently open. > > It doesn't have sufficient information (but that may not matter, se

Re: [C++ PATCH] pr 67273 & 79253 lambdas, warnings & ICEs

2017-01-31 Thread Nathan Sidwell
On 01/30/2017 03:48 PM, Jason Merrill wrote: Why can't it figure that out for itself? We should be able to tell whether its containing function is currently open. It doesn't have sufficient information (but that may not matter, see below). template void Foo (T lam) { lam (1u); // #1 } te

Re: [C++ PATCH] pr 67273 & 79253 lambdas, warnings & ICEs

2017-01-30 Thread Jason Merrill
On Fri, Jan 27, 2017 at 7:45 AM, Nathan Sidwell wrote: > Jason, > I happened to be working on 67273, noticed a problem with my 77585 fix, and > coincidentally 79253 got filed, which this also fixes. > > In 67253, Wshadow checking was getting confused when determining the return > type of an insta