On Wed, Jul 17, 2013 at 5:43 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Patch attached.  Fixes PR16646.  The concept is that when substitution<br>
replaces a pack with another pack, we don't want to expand the pack<br>
immediately: we want to expand it at the same level as the original<br>
pack.<br></blockquote><div><br></div><div>How do we ensure that the we retain a pack expansion around the transformed entity?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I'm not confident that this patch is correct, though: just stripping<br>
off the PackExpansionType in the middle of instantiation seems weird.<br>
Also, I'm not sure what other tests would be relevant.</blockquote><div><br></div><div>The patch only covers type template parameters; presumably, the same issue applies to non-type template parameters and template template parameters?</div>
<div><br></div><div>Does this correctly handle expanding the pack into a fixed set of parameters and a pack, in cases like:</div><div><br></div><div>template<typename ...Ts> struct S {};</div><div>template<typename ...Ts> using X = S<S<Ts>...>;</div>
<div>template<typename ...Ts> void f(X<int, Ts...> x);</div><div>void g() { f(X<int, int, int>()); }</div><div><br></div><div>? (I think it should, but this seems worth testing.)</div></div>