<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 13, 2011, at 10:09 PM, David Blaikie wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">[& of course I forget to include the patch. Attached now]<br><br><div class="gmail_quote">On Thu, Oct 13, 2011 at 10:09 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">From the bug:<br><br><pre>template<int ...Values, int After> struct X0nt;
X0nt<42> f();</pre><br>Causes clang to fail an assertion (SemaTemplate.cpp:4868 - "Converted template argument list is too short!"). This fix causes CheckTemplateArgumentList to fail if there are parameter packs anywhere other than the last argument in a non-partial application of the template arguments (partial applications include function templates for which non-final parameter packs may be valid. This change does not regress that behavior as far as I know/as far as the test cases already cover it).<br>

<br>I've included a test for this fix.<br><br>As an added bonus, I've also fixed a minor quirk in the output of the diagnostic that appears here ("template parameter pack must be the last template parameter") - currently/without my patch, Clang produces this diagnostic for every parameter after a parameter pack. So in the case of "template<typename ...A, typename B, typename C> struct foo;" the error is emitted twice (though, strangely, the second type it is produced it does not provide the context/line location, though the line/col numbers are the same & still correct). I've fixed that issue & modified a test case to catch it too.<br>

<br>Let me know if this looks good & I'll check it in,<br></blockquote></div></blockquote></div><br><div>LGTM!</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">       </span>- Doug</div></body></html>