<div dir="ltr">Your example doesn't compile for me.<div><br></div><div>Lambdas in contexts where they would be instantiated should have their surrounding declaration context mangled in as part of their external name (template args, etc.), I am left a bit confused as to where we would need to avoid propagating the mangling number.</div>
<div><br></div><div>What about the bodies of these lambdas? I don't see why it wouldn't be fine for the bodies of the lambdas to have the same mangling number.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sun, Nov 17, 2013 at 5:21 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  Does this do the right thing in the context of variadic template pack expansions? For lambda expressions, we deliberately do not inherit the mangling number because that would not be correct:<br>
<br>
    template<typename ...Ts> void f(std::function<T()> ...fn = []{ return T(); }) {}<br>
<br>
  ... would give all the instantiated lambdas the same mangling number, for instance.<br>
<br>
  What we do for lambdas is to compute the mangling number during instantiation in the same way we compute it during parsing.<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D2203" target="_blank">http://llvm-reviews.chandlerc.com/D2203</a><br>
</blockquote></div><br></div>