Patch to fix IRGen crash using lambda expression as value in dictionary literal

Reid Kleckner rnk at google.com
Wed Sep 17 13:17:04 PDT 2014


On Wed, Sep 17, 2014 at 12:10 PM, jahanian <fjahanian at apple.com> wrote:

>
> On Sep 16, 2014, at 5:44 PM, Reid Kleckner <rnk at google.com> wrote:
>
> > I mean, there's got to be a way to inject some destructor cleanups into
> the lambda, like:
> >
> > struct A { ~A(); };
> > int f(A) { return 42; }
> > id test_dict()
> > {
> >         return @{
> >                 @"a": [x=f(A())]() { return x; },
> >                 @"b": [x=f(A())]() { return x; }
> >         };
> > }
> >
> > Does this change affect where ~A gets called?
> >
>
> With John’s suggested patch I sent earlier, cleanup code to effect
> conversion to block expression is moved to
> where outer-most expression (one passed to return) is seen. So, new patch
> does not affect where ~A
> gets called.
>

Cool, sounds good to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140917/7f30f9ce/attachment.html>


More information about the cfe-commits mailing list